Skip to content

Commit

Permalink
[python] add ruff linting support and exclude outdated flake8 rules
Browse files Browse the repository at this point in the history
Signed-off-by: James McCorrie <[email protected]>
  • Loading branch information
James McCorrie committed Feb 12, 2025
1 parent 93bc27c commit 60d8c6f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ ignore =
# the '=' sign in keyword arguments. Unfortunately, yapf inserts
# them when there's a long argument (help text, for example).
E251,
# Don't complain about line breaks after operators
W504
# Don't complain about line breaks before or after operators. The
# recomendations on this have changed in 2016, so leave out the explicit
# checks: https://www.flake8rules.com/rules/W503.html
W503, W504
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,12 @@ dependencies = [
[tool.setuptools]
# This is actually not a python project, we just use pyproject.toml to manage dependencies.
py-modules = []

[tool.ruff]
target-version = "py38"
line-length = 100

[tool.ruff.lint]
preview = true
explicit-preview-rules = true
select = ["ALL", "E303", "W391"]

0 comments on commit 60d8c6f

Please sign in to comment.