From 721ddf318379ed99b1375fdcf916a0b7e0033040 Mon Sep 17 00:00:00 2001 From: emdneto <9735060+emdneto@users.noreply.github.com> Date: Sun, 13 Oct 2024 12:54:48 -0300 Subject: [PATCH] update pyproject.toml and pre-commit to auto fix lint Signed-off-by: emdneto <9735060+emdneto@users.noreply.github.com> --- .pre-commit-config.yaml | 1 + pyproject.toml | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 725bda5f88..67c236f93c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,5 +5,6 @@ repos: hooks: # Run the linter. - id: ruff + args: [--fix] # Run the formatter. - id: ruff-format diff --git a/pyproject.toml b/pyproject.toml index 2a4125b082..71e874501a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = [