2022-12-06 07:17:52 +08:00
|
|
|
---
|
|
|
|
ci:
|
|
|
|
autoupdate_schedule: quarterly
|
2023-04-04 08:54:44 +08:00
|
|
|
default_language_version: python3.11
|
2022-12-06 07:17:52 +08:00
|
|
|
|
|
|
|
repos:
|
2022-12-07 05:52:30 +08:00
|
|
|
- repo: https://github.com/asottile/add-trailing-comma.git
|
2023-10-03 08:40:18 +08:00
|
|
|
rev: v3.1.0
|
2022-12-07 05:52:30 +08:00
|
|
|
hooks:
|
|
|
|
- id: add-trailing-comma
|
|
|
|
|
|
|
|
- repo: https://github.com/PyCQA/isort.git
|
2023-03-11 03:27:46 +08:00
|
|
|
rev: 5.12.0
|
2022-12-07 05:52:30 +08:00
|
|
|
hooks:
|
|
|
|
- id: isort
|
|
|
|
args:
|
|
|
|
- --honor-noqa
|
|
|
|
|
2022-12-06 07:17:52 +08:00
|
|
|
- repo: https://github.com/Lucas-C/pre-commit-hooks.git
|
2023-10-03 08:40:18 +08:00
|
|
|
rev: v1.5.4
|
2022-12-06 07:17:52 +08:00
|
|
|
hooks:
|
|
|
|
- id: remove-tabs
|
|
|
|
|
|
|
|
- repo: https://github.com/python-jsonschema/check-jsonschema.git
|
2023-10-03 08:40:18 +08:00
|
|
|
rev: 0.27.0
|
2022-12-06 07:17:52 +08:00
|
|
|
hooks:
|
2022-12-07 04:44:04 +08:00
|
|
|
- id: check-github-actions
|
2022-12-06 07:17:52 +08:00
|
|
|
- id: check-github-workflows
|
|
|
|
- id: check-jsonschema
|
|
|
|
name: Check GitHub Workflows set timeout-minutes
|
|
|
|
args:
|
|
|
|
- --builtin-schema
|
|
|
|
- github-workflows-require-timeout
|
|
|
|
files: ^\.github/workflows/[^/]+$
|
|
|
|
types:
|
|
|
|
- yaml
|
|
|
|
- id: check-readthedocs
|
|
|
|
|
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks.git
|
2023-01-03 04:49:16 +08:00
|
|
|
rev: v4.4.0
|
2022-12-06 07:17:52 +08:00
|
|
|
hooks:
|
|
|
|
# Side-effects:
|
|
|
|
- id: end-of-file-fixer
|
|
|
|
- id: trailing-whitespace
|
|
|
|
- id: mixed-line-ending
|
|
|
|
# Non-modifying checks:
|
2022-12-07 05:52:30 +08:00
|
|
|
- id: name-tests-test
|
|
|
|
files: >-
|
|
|
|
^tests/[^_].*\.py$
|
2022-12-06 07:17:52 +08:00
|
|
|
- id: check-added-large-files
|
|
|
|
- id: check-byte-order-marker
|
|
|
|
- id: check-case-conflict
|
|
|
|
- id: check-executables-have-shebangs
|
|
|
|
- id: check-merge-conflict
|
|
|
|
- id: check-json
|
|
|
|
- id: check-symlinks
|
|
|
|
- id: check-yaml
|
|
|
|
- id: detect-private-key
|
2022-12-07 05:52:30 +08:00
|
|
|
# Heavy checks:
|
|
|
|
- id: check-ast
|
|
|
|
- id: debug-statements
|
|
|
|
language_version: python3
|
2022-12-06 07:17:52 +08:00
|
|
|
|
|
|
|
- repo: https://github.com/codespell-project/codespell
|
2023-10-03 08:40:18 +08:00
|
|
|
rev: v2.2.6
|
2022-12-06 07:17:52 +08:00
|
|
|
hooks:
|
|
|
|
- id: codespell
|
|
|
|
|
|
|
|
- repo: https://github.com/adrienverge/yamllint.git
|
2023-07-04 06:49:42 +08:00
|
|
|
rev: v1.32.0
|
2022-12-06 07:17:52 +08:00
|
|
|
hooks:
|
|
|
|
- id: yamllint
|
|
|
|
files: \.(yaml|yml)$
|
|
|
|
types:
|
|
|
|
- file
|
|
|
|
- yaml
|
|
|
|
args:
|
|
|
|
- --strict
|
|
|
|
|
2022-12-07 05:52:30 +08:00
|
|
|
- repo: https://github.com/PyCQA/flake8.git
|
2023-10-03 08:40:18 +08:00
|
|
|
rev: 6.1.0
|
2022-12-07 05:52:30 +08:00
|
|
|
hooks:
|
|
|
|
- id: flake8
|
|
|
|
alias: flake8-no-wps
|
|
|
|
name: flake8 WPS-excluded
|
|
|
|
args:
|
|
|
|
- --ignore
|
|
|
|
- >-
|
|
|
|
D100,
|
|
|
|
D101,
|
|
|
|
D103,
|
|
|
|
D107,
|
|
|
|
E402,
|
|
|
|
E501,
|
|
|
|
additional_dependencies:
|
|
|
|
- flake8-2020 ~= 1.7.0
|
|
|
|
- flake8-pytest-style ~= 1.6.0
|
|
|
|
|
|
|
|
- repo: https://github.com/PyCQA/flake8.git
|
|
|
|
# NOTE: This is kept at v4 for until WPS starts supporting flake v5.
|
2023-11-29 10:23:18 +08:00
|
|
|
rev: 4.0.1 # enforce-version: 4.0.1
|
2022-12-07 05:52:30 +08:00
|
|
|
hooks:
|
|
|
|
- id: flake8
|
|
|
|
alias: flake8-only-wps
|
|
|
|
name: flake8 WPS-only
|
|
|
|
args:
|
|
|
|
- --ignore
|
2023-03-07 04:03:34 +08:00
|
|
|
# NOTE: WPS326: Found implicit string concatenation
|
|
|
|
# NOTE: WPS332: Found walrus operator
|
2022-12-07 05:52:30 +08:00
|
|
|
- >-
|
|
|
|
WPS102,
|
|
|
|
WPS110,
|
|
|
|
WPS111,
|
|
|
|
WPS305,
|
2023-03-07 04:03:34 +08:00
|
|
|
WPS326,
|
|
|
|
WPS332,
|
2022-12-07 05:52:30 +08:00
|
|
|
WPS347,
|
|
|
|
WPS360,
|
|
|
|
WPS421,
|
|
|
|
WPS422,
|
|
|
|
WPS432,
|
|
|
|
WPS433,
|
|
|
|
WPS437,
|
|
|
|
WPS440,
|
|
|
|
WPS441,
|
|
|
|
WPS453,
|
|
|
|
- --select
|
|
|
|
- WPS
|
|
|
|
additional_dependencies:
|
2023-04-04 08:54:44 +08:00
|
|
|
- wemake-python-styleguide ~= 0.17.0
|
2022-12-07 05:52:30 +08:00
|
|
|
|
|
|
|
- repo: https://github.com/PyCQA/pylint.git
|
2023-10-03 08:40:18 +08:00
|
|
|
rev: v3.0.0
|
2022-12-07 05:52:30 +08:00
|
|
|
hooks:
|
|
|
|
- id: pylint
|
|
|
|
args:
|
|
|
|
- --disable
|
|
|
|
- >-
|
|
|
|
import-error,
|
|
|
|
invalid-name,
|
|
|
|
line-too-long,
|
|
|
|
missing-class-docstring,
|
|
|
|
missing-function-docstring,
|
|
|
|
missing-module-docstring,
|
|
|
|
protected-access,
|
|
|
|
super-init-not-called,
|
|
|
|
unused-argument,
|
|
|
|
wrong-import-position,
|
|
|
|
- --output-format
|
|
|
|
- colorized
|
|
|
|
|
|
|
|
- repo: local
|
|
|
|
hooks:
|
|
|
|
- id: enforced-flake8-version
|
|
|
|
name: Verify that enforced flake8 version stays unchanged
|
|
|
|
description: >-
|
|
|
|
This is a sanity check and fixer that makes sure that
|
|
|
|
the `flake8` version in this file remains matching the
|
|
|
|
corresponding request in the `# enforce-version` comment.
|
|
|
|
# Using Python here because using
|
|
|
|
# shell test does not always work in CIs:
|
|
|
|
entry: >-
|
|
|
|
python -c 'import pathlib, re, sys;
|
|
|
|
pre_commit_config = pathlib.Path(sys.argv[1]);
|
|
|
|
cfg_txt = pre_commit_config.read_text();
|
|
|
|
new_cfg_txt = re.sub(
|
|
|
|
r"(?P<spaces>\s+)rev:\s(?:\d+\.\d+\.\d+)\s{0,2}"
|
|
|
|
r"#\senforce-version:\s(?P<enforced_version>\d+\.\d+\.\d+)"
|
|
|
|
r"[ \t\f\v]*",
|
|
|
|
r"\g<spaces>rev: \g<enforced_version> "
|
|
|
|
r"# enforce-version: \g<enforced_version>",
|
|
|
|
cfg_txt,
|
|
|
|
);
|
|
|
|
cfg_txt != new_cfg_txt and
|
|
|
|
pre_commit_config.write_text(new_cfg_txt)
|
|
|
|
'
|
|
|
|
pass_filenames: true
|
|
|
|
language: system
|
|
|
|
files: >-
|
|
|
|
^\.pre-commit-config\.ya?ml$
|
|
|
|
types:
|
|
|
|
- yaml
|
|
|
|
|
2022-12-06 07:17:52 +08:00
|
|
|
...
|