Add pre-commit hooks
This commit is contained in:
30
.pre-commit-config.yaml
Normal file
30
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v4.4.0
|
||||||
|
hooks:
|
||||||
|
# Identify invalid files
|
||||||
|
- id: check-ast
|
||||||
|
- id: check-json
|
||||||
|
- id: check-yaml
|
||||||
|
|
||||||
|
# git checks
|
||||||
|
- id: check-merge-conflict
|
||||||
|
- id: check-added-large-files
|
||||||
|
- id: check-case-conflict
|
||||||
|
|
||||||
|
# Python checks
|
||||||
|
- id: check-docstring-first
|
||||||
|
- id: requirements-txt-fixer
|
||||||
|
- id: fix-byte-order-marker
|
||||||
|
|
||||||
|
# General quality checks
|
||||||
|
- id: mixed-line-ending
|
||||||
|
- id: trailing-whitespace
|
||||||
|
args: [--markdown-linebreak-ext=md]
|
||||||
|
- id: check-executables-have-shebangs
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
|
||||||
|
- repo: https://github.com/pycqa/flake8
|
||||||
|
rev: 6.0.0
|
||||||
|
hooks:
|
||||||
|
- id: flake8
|
@@ -75,10 +75,16 @@ Komikku can be built in a Python virtual environment. However, some tools and de
|
|||||||
```sh
|
```sh
|
||||||
# Create venv
|
# Create venv
|
||||||
python3 -m venv .venv
|
python3 -m venv .venv
|
||||||
|
|
||||||
# Activate venv
|
# Activate venv
|
||||||
source .venv/bin/activate
|
source .venv/bin/activate
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
|
pip install -r requirements-dev.txt
|
||||||
|
|
||||||
|
# Install pre-commit hooks
|
||||||
|
pre-commit install
|
||||||
```
|
```
|
||||||
|
|
||||||
NOTE: Python package `file-magic` is an possible alternative to `python-magic`.
|
NOTE: Python package `file-magic` is an possible alternative to `python-magic`.
|
||||||
|
5
requirements-dev.txt
Normal file
5
requirements-dev.txt
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
flake8
|
||||||
|
pre-commit
|
||||||
|
pycodestyle
|
||||||
|
pytest
|
||||||
|
pytest-steps
|
Reference in New Issue
Block a user