Skip to content

Commit

Permalink
update pyproject.toml and pre-commit to auto fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: emdneto <[email protected]>
  • Loading branch information
emdneto committed Oct 13, 2024
1 parent 2cda6dc commit 721ddf3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ repos:
hooks:
# Run the linter.
- id: ruff
args: [--fix]
# Run the formatter.
- id: ruff-format
20 changes: 16 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,27 @@ line-length = 79
extend-exclude = [
"*_pb2*.py*",
]
fix = true
output-format = "concise"

[tool.ruff.lint]
# https://docs.astral.sh/ruff/linter/#rule-selection
# pylint: https://github.com/astral-sh/ruff/issues/970
select = ["E4", "E7", "E9", "F", "W", "Q", "I", "PLE"]
fixable = ["I", "F", "Q", "W"]
ignore = ["F401", "E501"] # TODO: fix all of them later
select = [
"I", # isort
"F", # pyflakes
"E", # pycodestyle errors
"W", # pycodestyle warnings
"PLC", # pylint - convention
"PLE", # pylint - error
"Q", # flake8-quotes
]

ignore = [
"E501", # line-too-long
]

[tool.ruff.lint.per-file-ignores]
"docs/**/*.*" = ["PLE"]

[tool.ruff.lint.isort]
known-third-party = [
Expand Down

0 comments on commit 721ddf3

Please sign in to comment.