mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
chore(pre-commit) Use hooks from official repositories
The reason behind this is to make checking and formatting consistent between contributors and CI. It is also easier to incorporate new hooks, since many tools already provides pre-commit hooks In addition this commit also adds `black` and `autoflake` along with a few other useful hooks from the `pre-commit-hooks` repository.
This commit is contained in:
parent
08d485206c
commit
b47882b114
4 changed files with 602 additions and 187 deletions
|
@ -1,24 +1,37 @@
|
|||
hooks:
|
||||
- &base
|
||||
language: python
|
||||
types: [python]
|
||||
require_serial: true
|
||||
exclude: ^migrations/versions
|
||||
- &flake8
|
||||
id: flake8
|
||||
name: flake8
|
||||
entry: flake8
|
||||
<<: *base
|
||||
- &isort
|
||||
id: isort
|
||||
name: isort
|
||||
entry: isort
|
||||
<<: *base
|
||||
|
||||
repos:
|
||||
- repo: local
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.3.0
|
||||
hooks:
|
||||
- <<: *flake8
|
||||
- <<: *isort
|
||||
args: ['--check-only', '--diff']
|
||||
- id: check-added-large-files
|
||||
- id: check-case-conflict
|
||||
- id: check-merge-conflict
|
||||
- id: check-toml
|
||||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace
|
||||
- id: debug-statements
|
||||
|
||||
- repo: https://github.com/myint/autoflake
|
||||
rev: v1.4
|
||||
hooks:
|
||||
- id: autoflake
|
||||
args:
|
||||
- --in-place
|
||||
- --remove-all-unused-imports
|
||||
- --ignore-init-module-imports
|
||||
|
||||
- repo: https://github.com/pycqa/isort
|
||||
rev: 5.10.1
|
||||
hooks:
|
||||
- id: isort
|
||||
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 22.6.0
|
||||
hooks:
|
||||
- id: black
|
||||
|
||||
- repo: https://github.com/PyCQA/flake8
|
||||
rev: 5.0.4
|
||||
hooks:
|
||||
- id: flake8
|
||||
|
|
715
poetry.lock
generated
715
poetry.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -1,3 +1,11 @@
|
|||
[tool.black]
|
||||
line-length = 88
|
||||
|
||||
[tool.isort]
|
||||
profile = "black"
|
||||
combine_as_imports = true
|
||||
|
||||
|
||||
# Poetry build configuration for the aurweb project.
|
||||
#
|
||||
# Dependencies:
|
||||
|
@ -89,8 +97,6 @@ fastapi = "^0.71.0"
|
|||
srcinfo = "^0.0.8"
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
flake8 = "^4.0.1"
|
||||
isort = "^5.9.3"
|
||||
coverage = "^6.0.2"
|
||||
pytest = "^6.2.5"
|
||||
pytest-asyncio = "^0.16.0"
|
||||
|
|
11
setup.cfg
11
setup.cfg
|
@ -1,7 +1,3 @@
|
|||
[pycodestyle]
|
||||
max-line-length = 127
|
||||
ignore = E741, W503
|
||||
|
||||
[flake8]
|
||||
max-line-length = 127
|
||||
max-complexity = 10
|
||||
|
@ -17,9 +13,4 @@ max-complexity = 10
|
|||
# With {W503,W504}, PEP8 does not want us to break lines before
|
||||
# or after a binary operator. We have many scripts that already
|
||||
# do this, so we're ignoring it here.
|
||||
ignore = E741, W503, W504
|
||||
|
||||
[isort]
|
||||
line_length = 127
|
||||
lines_between_types = 1
|
||||
|
||||
ignore = E203, E741, W503, W504
|
||||
|
|
Loading…
Add table
Reference in a new issue