mirror of
https://github.com/bellingcat/auto-archiver-api.git
synced 2026-06-12 05:28:34 +03:00
Add pre-commit with GiHub Action (#56)
* Update pyproject.toml * add pre-commit * Create .pre-commit-config.yaml * Comment out ruff * Update .pre-commit-config.yaml * General formatting * Create format-and-fail.yml * Update ci.yml * Add pre-commit to dev dependencies * Update pyproject.toml
This commit is contained in:
79
.pre-commit-config.yaml
Normal file
79
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,79 @@
|
||||
repos:
|
||||
- repo: https://github.com/nbQA-dev/nbQA
|
||||
rev: 1.8.5
|
||||
hooks:
|
||||
- id: nbqa-ruff
|
||||
args:
|
||||
- --fix
|
||||
- --target-version=py311
|
||||
- --ignore=E721,E722
|
||||
- --line-length=80
|
||||
- id: nbqa-black
|
||||
args:
|
||||
- --line-length=80
|
||||
- id: nbqa-isort
|
||||
args:
|
||||
- --float-to-top
|
||||
- --profile=black
|
||||
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.4.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: check-docstring-first
|
||||
- id: check-executables-have-shebangs
|
||||
- id: check-json
|
||||
- id: check-case-conflict
|
||||
- id: check-toml
|
||||
- id: check-merge-conflict
|
||||
- id: check-xml
|
||||
- id: check-yaml
|
||||
exclude: app/tests/user-groups.test.broken.yaml
|
||||
- id: end-of-file-fixer
|
||||
- id: check-symlinks
|
||||
- id: mixed-line-ending
|
||||
- id: sort-simple-yaml
|
||||
- id: fix-encoding-pragma
|
||||
args:
|
||||
- --remove
|
||||
- id: pretty-format-json
|
||||
args:
|
||||
- --autofix
|
||||
|
||||
- repo: https://github.com/pre-commit/pygrep-hooks
|
||||
rev: v1.10.0
|
||||
hooks:
|
||||
- id: python-check-blanket-noqa
|
||||
- id: python-check-mock-methods
|
||||
- id: python-no-eval
|
||||
- id: python-no-log-warn
|
||||
|
||||
- repo: https://github.com/PyCQA/isort
|
||||
rev: 5.12.0
|
||||
hooks:
|
||||
- id: isort
|
||||
name: Run isort to sort imports
|
||||
files: \.py$
|
||||
# To keep consistent with the global isort skip config defined in setup.cfg
|
||||
exclude: ^build/.*$|^.tox/.*$|^venv/.*$
|
||||
args:
|
||||
- --lines-after-imports=2
|
||||
- --profile=black
|
||||
- --line-length=80
|
||||
|
||||
# - repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
# rev: v0.4.10
|
||||
# hooks:
|
||||
# - id: ruff
|
||||
# types_or: [python,pyi]
|
||||
# args:
|
||||
# - --fix
|
||||
# - --target-version=py311
|
||||
# - --select=B,C,E,F,W,B9
|
||||
# - --line-length=80
|
||||
# - --ignore=E203,E402,E501,E261
|
||||
# - id: ruff-format
|
||||
# types_or: [ python,pyi]
|
||||
# args:
|
||||
# - --target-version=py311
|
||||
# - --line-length=80
|
||||
Reference in New Issue
Block a user