2020-09-30 16:39:14 +08:00
|
|
|
repos:
|
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
2022-11-29 23:56:41 +08:00
|
|
|
rev: v4.4.0
|
2020-09-30 16:39:14 +08:00
|
|
|
hooks:
|
|
|
|
- id: check-executables-have-shebangs
|
|
|
|
- id: check-yaml
|
|
|
|
- id: end-of-file-fixer
|
|
|
|
types: [python]
|
2020-10-15 19:20:43 +08:00
|
|
|
- id: trailing-whitespace
|
2020-09-30 16:39:14 +08:00
|
|
|
- id: requirements-txt-fixer
|
2021-11-16 22:01:17 +08:00
|
|
|
|
2022-10-28 21:54:54 +08:00
|
|
|
- repo: https://github.com/MarcoGorelli/auto-walrus
|
2022-12-20 06:04:34 +08:00
|
|
|
rev: v0.2.2
|
2022-10-28 21:54:54 +08:00
|
|
|
hooks:
|
|
|
|
- id: auto-walrus
|
|
|
|
|
2020-09-30 16:39:14 +08:00
|
|
|
- repo: https://github.com/psf/black
|
2023-02-01 21:14:54 +08:00
|
|
|
rev: 23.1.0
|
2020-09-30 16:39:14 +08:00
|
|
|
hooks:
|
|
|
|
- id: black
|
2021-11-16 22:01:17 +08:00
|
|
|
|
2020-09-30 16:39:14 +08:00
|
|
|
- repo: https://github.com/PyCQA/isort
|
2023-01-31 06:42:15 +08:00
|
|
|
rev: 5.12.0
|
2020-09-30 16:39:14 +08:00
|
|
|
hooks:
|
|
|
|
- id: isort
|
|
|
|
args:
|
|
|
|
- --profile=black
|
2021-11-16 22:01:17 +08:00
|
|
|
|
2023-02-01 21:14:54 +08:00
|
|
|
- repo: https://github.com/tox-dev/pyproject-fmt
|
2023-02-28 06:08:40 +08:00
|
|
|
rev: "0.9.2"
|
2023-02-01 21:14:54 +08:00
|
|
|
hooks:
|
|
|
|
- id: pyproject-fmt
|
|
|
|
|
|
|
|
- repo: https://github.com/abravalheri/validate-pyproject
|
|
|
|
rev: v0.12.1
|
|
|
|
hooks:
|
|
|
|
- id: validate-pyproject
|
|
|
|
|
2021-10-28 22:45:59 +08:00
|
|
|
- repo: https://github.com/asottile/pyupgrade
|
2022-12-13 04:29:50 +08:00
|
|
|
rev: v3.3.1
|
2021-10-28 22:45:59 +08:00
|
|
|
hooks:
|
|
|
|
- id: pyupgrade
|
|
|
|
args:
|
2022-11-16 01:34:17 +08:00
|
|
|
- --py311-plus
|
2021-11-16 22:01:17 +08:00
|
|
|
|
2023-02-28 06:08:40 +08:00
|
|
|
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
2023-03-14 06:18:35 +08:00
|
|
|
rev: v0.0.255
|
2023-02-28 06:08:40 +08:00
|
|
|
hooks:
|
|
|
|
- id: ruff
|
|
|
|
args:
|
|
|
|
- --ignore=E741
|
|
|
|
|
2022-10-04 04:00:45 +08:00
|
|
|
- repo: https://github.com/PyCQA/flake8
|
2022-11-29 23:56:41 +08:00
|
|
|
rev: 6.0.0
|
2020-09-30 16:39:14 +08:00
|
|
|
hooks:
|
2022-10-14 22:34:44 +08:00
|
|
|
- id: flake8 # See .flake8 for args
|
2022-10-29 21:07:02 +08:00
|
|
|
additional_dependencies: &flake8-plugins
|
2022-10-14 00:03:06 +08:00
|
|
|
- flake8-bugbear
|
|
|
|
- flake8-builtins
|
2022-11-29 23:56:41 +08:00
|
|
|
# - flake8-broken-line
|
2022-10-16 01:29:42 +08:00
|
|
|
- flake8-comprehensions
|
2022-10-14 00:03:06 +08:00
|
|
|
- pep8-naming
|
2022-10-29 21:07:02 +08:00
|
|
|
|
|
|
|
- repo: https://github.com/asottile/yesqa
|
|
|
|
rev: v1.4.0
|
|
|
|
hooks:
|
|
|
|
- id: yesqa
|
|
|
|
additional_dependencies:
|
|
|
|
*flake8-plugins
|
2021-11-16 22:01:17 +08:00
|
|
|
|
|
|
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
2023-03-14 06:18:35 +08:00
|
|
|
rev: v1.1.1
|
2021-11-16 22:01:17 +08:00
|
|
|
hooks:
|
|
|
|
- id: mypy
|
|
|
|
args:
|
|
|
|
- --ignore-missing-imports
|
2022-10-14 22:34:44 +08:00
|
|
|
- --install-types # See mirrors-mypy README.md
|
2021-11-16 22:01:17 +08:00
|
|
|
- --non-interactive
|
2022-10-03 03:59:17 +08:00
|
|
|
additional_dependencies: [types-requests]
|
2021-11-16 22:01:17 +08:00
|
|
|
|
2020-09-30 16:39:14 +08:00
|
|
|
- repo: https://github.com/codespell-project/codespell
|
2023-03-14 06:18:35 +08:00
|
|
|
rev: v2.2.4
|
2020-09-30 16:39:14 +08:00
|
|
|
hooks:
|
|
|
|
- id: codespell
|
|
|
|
args:
|
2023-03-14 06:18:35 +08:00
|
|
|
- --ignore-words-list=3rt,ans,crate,damon,fo,followings,hist,iff,kwanza,mater,secant,som,sur,tim,zar
|
2020-09-30 16:39:14 +08:00
|
|
|
exclude: |
|
|
|
|
(?x)^(
|
2022-10-18 03:59:25 +08:00
|
|
|
ciphers/prehistoric_men.txt |
|
2021-03-21 19:05:10 +08:00
|
|
|
strings/dictionary.txt |
|
2021-03-22 18:40:23 +08:00
|
|
|
strings/words.txt |
|
2020-10-15 15:13:28 +08:00
|
|
|
project_euler/problem_022/p022_names.txt
|
2020-09-30 16:39:14 +08:00
|
|
|
)$
|
2021-11-16 22:01:17 +08:00
|
|
|
|
2020-09-30 16:39:14 +08:00
|
|
|
- repo: local
|
|
|
|
hooks:
|
|
|
|
- id: validate-filenames
|
|
|
|
name: Validate filenames
|
|
|
|
entry: ./scripts/validate_filenames.py
|
|
|
|
language: script
|
|
|
|
pass_filenames: false
|