Skip to content

Commit b3b738c

Browse files
authored
Upgrade pre-commit and flake8 (#18)
1 parent 51a5311 commit b3b738c

File tree

3 files changed

+41
-26
lines changed

3 files changed

+41
-26
lines changed

{{cookiecutter.package_name}}/.flake8

Lines changed: 0 additions & 17 deletions
This file was deleted.

{{cookiecutter.package_name}}/.pre-commit-config.yaml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
default_language_version:
2+
node: system
3+
14
repos:
25
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.2.0
6+
rev: v4.3.0
47
hooks:
58
- id: end-of-file-fixer
69
- id: check-case-conflict
@@ -16,19 +19,18 @@ repos:
1619
- id: trailing-whitespace
1720

1821
- repo: https://github.com/psf/black
19-
rev: 22.3.0
22+
rev: 22.10.0
2023
hooks:
2124
- id: black
2225

2326
- repo: https://github.com/PyCQA/isort
2427
rev: 5.10.1
2528
hooks:
2629
- id: isort
27-
args: ["--profile", "black"]
2830
files: \.py$
2931

3032
- repo: https://github.com/pre-commit/mirrors-mypy
31-
rev: v0.950
33+
rev: v0.982
3234
hooks:
3335
- id: mypy
3436
additional_dependencies: [types-requests]
@@ -45,21 +47,30 @@ repos:
4547
- id: mdformat
4648

4749
- repo: https://github.com/asottile/pyupgrade
48-
rev: v2.32.1
50+
rev: v3.0.0
4951
hooks:
5052
- id: pyupgrade
5153
args: [--py37-plus]
5254

53-
- repo: https://github.com/pycqa/flake8
54-
rev: 5.0.4
55+
- repo: https://github.com/PyCQA/doc8
56+
rev: v1.0.0
57+
hooks:
58+
- id: doc8
59+
args: [--max-line-length=200]
60+
exclude: docs/source/other/full-config.rst
61+
stages: [manual]
62+
63+
- repo: https://github.com/john-hen/Flake8-pyproject
64+
rev: 1.0.1
5565
hooks:
56-
- id: flake8
66+
- id: Flake8-pyproject
67+
alias: flake8
5768
additional_dependencies:
5869
["flake8-bugbear==22.6.22", "flake8-implicit-str-concat==0.2.0"]
5970
stages: [manual]
6071

6172
- repo: https://github.com/sirosen/check-jsonschema
62-
rev: 0.15.0
73+
rev: 0.18.3
6374
hooks:
6475
- id: check-jsonschema
6576
name: "Check GitHub Workflows"

{{cookiecutter.package_name}}/pyproject.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,24 @@ strict_equality = true
6464
warn_unused_configs = true
6565
warn_unused_ignores = true
6666
warn_redundant_casts = true
67+
68+
[tool.flake8]
69+
ignore = "E501, W503, E402"
70+
builtins = "c, get_config"
71+
exclude = [
72+
".cache",
73+
".github",
74+
"docs",
75+
"setup.py",
76+
]
77+
enable-extensions = "G"
78+
extend-ignore = [
79+
"G001", "G002", "G004", "G200", "G201", "G202",
80+
# black adds spaces around ':'
81+
"E203",
82+
]
83+
per-file-ignores = [
84+
# B011: Do not call assert False since python -O removes these calls
85+
# F841 local variable 'foo' is assigned to but never used
86+
"tests/*: B011", "F841",
87+
]

0 commit comments

Comments
 (0)