Skip to content

Commit

Permalink
Stop enforcing flake8 v4.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz authored Jul 2, 2024
1 parent 48279fa commit 3bfbb24
Showing 1 changed file with 1 addition and 34 deletions.
35 changes: 1 addition & 34 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ repos:
language_version: python3

- repo: https://github.com/PyCQA/flake8.git
# NOTE: This is kept at v4 for until WPS starts supporting flake v5.
rev: 7.1.0 # enforce-version: 4.0.1
rev: 7.1.0
hooks:
- id: flake8
alias: flake8-only-wps
Expand Down Expand Up @@ -142,36 +141,4 @@ repos:
- --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

...

0 comments on commit 3bfbb24

Please sign in to comment.