Skip to content

Commit 8ec9004

Browse files
machshevjwnrt
authored andcommitted
[python] add ruff linting support and exclude outdated flake8 rules
Signed-off-by: James McCorrie <[email protected]>
1 parent a4eb67b commit 8ec9004

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.flake8

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@ ignore =
66
# the '=' sign in keyword arguments. Unfortunately, yapf inserts
77
# them when there's a long argument (help text, for example).
88
E251,
9-
# Don't complain about line breaks after operators
10-
W504
9+
# Don't complain about line breaks before or after operators. The
10+
# recomendations on this have changed in 2016, so leave out the explicit
11+
# checks: https://www.flake8rules.com/rules/W503.html
12+
W503, W504

pyproject.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,12 @@ dependencies = [
9090
[tool.setuptools]
9191
# This is actually not a python project, we just use pyproject.toml to manage dependencies.
9292
py-modules = []
93+
94+
[tool.ruff]
95+
target-version = "py38"
96+
line-length = 100
97+
98+
[tool.ruff.lint]
99+
preview = true
100+
explicit-preview-rules = true
101+
select = ["ALL", "E303", "W391"]

0 commit comments

Comments
 (0)