Merge separate flake8 runs back into one
This commit is contained in:
parent
30ae1f14c1
commit
dbabd61607
|
@ -81,10 +81,10 @@ repos:
|
||||||
rev: 7.0.0
|
rev: 7.0.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: flake8
|
- id: flake8
|
||||||
alias: flake8-no-wps
|
|
||||||
name: flake8 WPS-excluded
|
|
||||||
args:
|
args:
|
||||||
- --ignore
|
- --ignore
|
||||||
|
# NOTE: WPS326: Found implicit string concatenation
|
||||||
|
# NOTE: WPS332: Found walrus operator
|
||||||
- >-
|
- >-
|
||||||
D100,
|
D100,
|
||||||
D101,
|
D101,
|
||||||
|
@ -92,22 +92,6 @@ repos:
|
||||||
D107,
|
D107,
|
||||||
E402,
|
E402,
|
||||||
E501,
|
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.
|
|
||||||
rev: 4.0.1 # enforce-version: 4.0.1
|
|
||||||
hooks:
|
|
||||||
- id: flake8
|
|
||||||
alias: flake8-only-wps
|
|
||||||
name: flake8 WPS-only
|
|
||||||
args:
|
|
||||||
- --ignore
|
|
||||||
# NOTE: WPS326: Found implicit string concatenation
|
|
||||||
# NOTE: WPS332: Found walrus operator
|
|
||||||
- >-
|
|
||||||
WPS102,
|
WPS102,
|
||||||
WPS110,
|
WPS110,
|
||||||
WPS111,
|
WPS111,
|
||||||
|
@ -124,9 +108,9 @@ repos:
|
||||||
WPS440,
|
WPS440,
|
||||||
WPS441,
|
WPS441,
|
||||||
WPS453,
|
WPS453,
|
||||||
- --select
|
|
||||||
- WPS
|
|
||||||
additional_dependencies:
|
additional_dependencies:
|
||||||
|
- flake8-2020 ~= 1.7.0
|
||||||
|
- flake8-pytest-style ~= 1.6.0
|
||||||
- wemake-python-styleguide ~= 0.19.0
|
- wemake-python-styleguide ~= 0.19.0
|
||||||
|
|
||||||
- repo: https://github.com/PyCQA/pylint.git
|
- repo: https://github.com/PyCQA/pylint.git
|
||||||
|
@ -149,36 +133,4 @@ repos:
|
||||||
- --output-format
|
- --output-format
|
||||||
- colorized
|
- 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
|
|
||||||
|
|
||||||
...
|
...
|
||||||
|
|
Loading…
Reference in New Issue