Skip to content

Commit 2dc4fcb

Browse files
trallardCarreaudrammock
committed
update pre-commit hooks / linter config
Co-authored-by: M Bussonnier <[email protected]> Co-authored-by: Daniel McCloy <[email protected]>
1 parent 33333c8 commit 2dc4fcb

File tree

2 files changed

+28
-17
lines changed

2 files changed

+28
-17
lines changed

.pre-commit-config.yaml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,38 @@ ci:
99
# Fix the node version to avoid a GLIBC error
1010
# ref: https://stackoverflow.com/questions/71939099/bitbucket-pipeline-error-installing-pre-commit-ts-lint/71940852#71940852
1111
default_language_version:
12-
node: 16.14.2
12+
node: 22.9.0
1313

1414
repos:
15-
- repo: https://github.com/pre-commit/mirrors-prettier
16-
rev: v4.0.0-alpha.8
15+
- repo: "https://github.com/pycontribs/mirrors-prettier"
16+
rev: v3.3.3
1717
hooks:
1818
- id: prettier
1919
# Exclude the HTML, since it doesn't understand Jinja2
2020
# exclude also the webpack.config.js file has it embed complete url dificult to prettify
2121
# exclude the pytest-regressions folder tests/test_ally
2222
exclude: .+\.html|webpack\.config\.js|tests/test_a11y/
2323

24-
- repo: https://github.com/psf/black
25-
rev: 24.10.0
26-
hooks:
27-
- id: black
28-
29-
- repo: https://github.com/astral-sh/ruff-pre-commit
24+
- repo: "https://github.com/astral-sh/ruff-pre-commit"
3025
rev: "v0.7.2"
3126
hooks:
3227
- id: ruff
28+
args: [--exit-non-zero-on-fix]
29+
- id: ruff-format
3330

34-
- repo: https://github.com/asottile/pyupgrade
31+
- repo: "https://github.com/asottile/pyupgrade"
3532
rev: v3.19.0
3633
hooks:
3734
- id: pyupgrade
3835
args: [--py37-plus]
3936

40-
- repo: https://github.com/Riverside-Healthcare/djLint
37+
- repo: "https://github.com/Riverside-Healthcare/djLint"
4138
rev: v1.35.4
4239
hooks:
4340
- id: djlint-jinja
4441
types_or: ["html"]
4542

46-
- repo: https://github.com/PyCQA/doc8
43+
- repo: "https://github.com/PyCQA/doc8"
4744
rev: v1.1.2
4845
hooks:
4946
- id: doc8
@@ -53,12 +50,12 @@ repos:
5350
hooks:
5451
- id: nbstripout
5552

56-
- repo: https://github.com/mondeja/pre-commit-po-hooks
53+
- repo: "https://github.com/mondeja/pre-commit-po-hooks"
5754
rev: v1.7.3
5855
hooks:
5956
- id: remove-metadata
6057

61-
- repo: https://github.com/thibaudcolas/pre-commit-stylelint
58+
- repo: "https://github.com/thibaudcolas/pre-commit-stylelint"
6259
rev: v16.10.0
6360
hooks:
6461
- id: stylelint
@@ -68,3 +65,9 @@ repos:
6865
# stylelint itself needs to be here when using additional_dependencies.
6966
7067
68+
69+
- repo: "https://github.com/pre-commit/pre-commit-hooks"
70+
rev: v5.0.0
71+
hooks:
72+
- id: trailing-whitespace
73+
- id: end-of-file-fixer

pyproject.toml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,22 +100,30 @@ ignore = ["D001"] # we follow a 1 line = 1 paragraph style
100100

101101
[tool.ruff]
102102
fix = true
103+
# keep consistent with black
104+
line-length = 88
105+
indent-width = 4
103106

104107
[tool.ruff.lint]
105108
ignore = [
106-
"E501", # line too long | Black take care of it
107109
"D107", # Missing docstring in `__init__` | set the docstring in the class
110+
"D205", # 1 blank line required between summary line and description,
111+
"D212", # docstring summary must be on first physical line
112+
"W291", # let pre-commit handle trailing whitespace
108113

109114
]
110-
ignore-init-module-imports = true
111-
select = ["E", "F", "W", "I", "D", "RUF"]
115+
select = ["E", "F", "W", "I", "D", "RUF", "G"]
112116

113117
[tool.ruff.lint.flake8-quotes]
114118
docstring-quotes = "double"
115119

116120
[tool.ruff.lint.pydocstyle]
117121
convention = "google"
118122

123+
[tool.ruff.lint.isort]
124+
lines-between-types = 1
125+
lines-after-imports = 2
126+
119127
[tool.djlint]
120128
profile = "jinja"
121129
extension = "html"

0 commit comments

Comments
 (0)