Skip to content

Commit d7314fe

Browse files
committed
Enable black in pep8 tox job, pre-commit
Signed-off-by: Stephen Finucane <[email protected]>
1 parent 41542c4 commit d7314fe

File tree

3 files changed

+34
-23
lines changed

3 files changed

+34
-23
lines changed

.pre-commit-config.yaml

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,28 @@ default_language_version:
33
# force all unspecified python hooks to run python3
44
python: python3
55
repos:
6-
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v4.2.0
8-
hooks:
9-
- id: check-executables-have-shebangs
10-
- id: check-merge-conflict
11-
- id: check-yaml
12-
- id: end-of-file-fixer
13-
exclude: (.*\.mbox)|(.*\.css)|(.*\.json)|(.*\.js)|(.*\.svg)|(.*/mails/.*-subject\.txt)
14-
- id: trailing-whitespace
15-
exclude: (.*\.mbox)|(.*\.svg)
16-
- repo: https://gitlab.com/pycqa/flake8
17-
rev: 3.9.2
18-
hooks:
19-
- id: flake8
20-
- repo: https://github.com/Lucas-C/pre-commit-hooks
21-
rev: v1.1.13
22-
hooks:
23-
- id: remove-tabs
24-
exclude: (.*\.mbox)|(.*\.svg)|(.*\.sql)|(.*\.conf)
25-
- id: remove-crlf
26-
exclude: (.*\.mbox)|(.*\.svg)
6+
- repo: https://github.com/pre-commit/pre-commit-hooks
7+
rev: v4.2.0
8+
hooks:
9+
- id: check-executables-have-shebangs
10+
- id: check-merge-conflict
11+
- id: check-yaml
12+
- id: end-of-file-fixer
13+
exclude: (.*\.mbox)|(.*\.css)|(.*\.json)|(.*\.js)|(.*\.svg)|(.*/mails/.*-subject\.txt)
14+
- id: trailing-whitespace
15+
exclude: (.*\.mbox)|(.*\.svg)
16+
- repo: https://gitlab.com/pycqa/flake8
17+
rev: 3.9.2
18+
hooks:
19+
- id: flake8
20+
- repo: https://github.com/psf/black
21+
rev: 22.3.0
22+
hooks:
23+
- id: black
24+
- repo: https://github.com/Lucas-C/pre-commit-hooks
25+
rev: v1.1.13
26+
hooks:
27+
- id: remove-tabs
28+
exclude: (.*\.mbox)|(.*\.svg)|(.*\.sql)|(.*\.conf)
29+
- id: remove-crlf
30+
exclude: (.*\.mbox)|(.*\.svg)

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[tool.black]
2+
line-length = 79
3+
skip-string-normalization = true

tox.ini

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@ commands =
3636
-name \*.sh -print | xargs bashate -i E006"
3737

3838
[testenv:pep8]
39-
deps = flake8
40-
commands = flake8 {posargs:patchwork manage.py}
39+
deps =
40+
black
41+
flake8
42+
commands =
43+
black --check --quiet {posargs:patchwork manage.py}
44+
flake8 {posargs:patchwork manage.py}
4145

4246
[flake8]
4347
# Some rules are ignored as their use makes the code more difficult to read:

0 commit comments

Comments
 (0)