Skip to content

Commit 721ddf3

Browse files
committed
update pyproject.toml and pre-commit to auto fix lint
Signed-off-by: emdneto <[email protected]>
1 parent 2cda6dc commit 721ddf3

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ repos:
55
hooks:
66
# Run the linter.
77
- id: ruff
8+
args: [--fix]
89
# Run the formatter.
910
- id: ruff-format

pyproject.toml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,27 @@ line-length = 79
1818
extend-exclude = [
1919
"*_pb2*.py*",
2020
]
21-
fix = true
2221
output-format = "concise"
2322

2423
[tool.ruff.lint]
2524
# https://docs.astral.sh/ruff/linter/#rule-selection
2625
# pylint: https://github.com/astral-sh/ruff/issues/970
27-
select = ["E4", "E7", "E9", "F", "W", "Q", "I", "PLE"]
28-
fixable = ["I", "F", "Q", "W"]
29-
ignore = ["F401", "E501"] # TODO: fix all of them later
26+
select = [
27+
"I", # isort
28+
"F", # pyflakes
29+
"E", # pycodestyle errors
30+
"W", # pycodestyle warnings
31+
"PLC", # pylint - convention
32+
"PLE", # pylint - error
33+
"Q", # flake8-quotes
34+
]
35+
36+
ignore = [
37+
"E501", # line-too-long
38+
]
39+
40+
[tool.ruff.lint.per-file-ignores]
41+
"docs/**/*.*" = ["PLE"]
3042

3143
[tool.ruff.lint.isort]
3244
known-third-party = [

0 commit comments

Comments
 (0)