From a6f53e5d47e657d20840311c4819fac4fd4b4aaa Mon Sep 17 00:00:00 2001 From: Bill Little Date: Thu, 30 Nov 2023 00:04:20 +0000 Subject: [PATCH] qualify ruff ignore rules with docs url (#542) --- .ruff.toml | 8 ++++++++ pyproject.toml | 15 ++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.ruff.toml b/.ruff.toml index 4e1446e5..f76d0471 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -5,12 +5,14 @@ lint.ignore = [ # ruff --select="ALL" --statistics src/geovista/ # flake8-boolean-trap (FBT) + # https://docs.astral.sh/ruff/rules/#flake8-boolean-trap-fbt # NOTE: A good thing to fix, but changes API. "FBT001", # boolean-positional-arg-in-function-definition. "FBT002", # boolean-default-value-in-function-definition. "FBT003", # boolean-positional-value-in-function-call. # Pylint (PL) + # https://docs.astral.sh/ruff/rules/#pylint-pl "PLR0912", # Too many branches. "PLR0913", # Too many arguments in function definition. "PLR0915", # Too many statements. @@ -18,28 +20,34 @@ lint.ignore = [ "PLW0603", # Using the global statement to update is discouraged. # flake8-self (SLF) + # https://docs.astral.sh/ruff/rules/#flake8-self-slf "SLF001", # Private member accessed. # flake8-todos (TD) + # https://docs.astral.sh/ruff/rules/#flake8-todos-td "TD003", # Missing issue link on the line following this TODO. ] [lint.extend-per-file-ignores] "conftest.py" = [ # flake8-annotations (ANN) + # https://docs.astral.sh/ruff/rules/#flake8-annotations-ann "ANN001", # Missing type annotation for function argument. "ANN201", # Missing return type annotation for public function. ] "src/geovista/geoplotter.py" = [ # flake8-annotations (ANN) + # https://docs.astral.sh/ruff/rules/#flake8-annotations-ann "ANN401", # Dynamically typed expressions (typing.Any). ] "test_*.py" = [ # flake8-annotations (ANN) + # https://docs.astral.sh/ruff/rules/#flake8-annotations-ann "ANN001", # Missing type annotation for function argument. "ANN201", # Missing return type annotation for public funciton. ] "test_slice_lines.py" = [ # eradicate (ERA) + # https://docs.astral.sh/ruff/rules/#eradicate-era "ERA001", # Found commented-out code. ] diff --git a/pyproject.toml b/pyproject.toml index bdc99ebd..dbcd4f85 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -116,33 +116,38 @@ ignore = [ # NOTE: Non-permanent exclusions should be added to ".ruff.toml". # flake8-annotations (ANN) + # https://docs.astral.sh/ruff/rules/#flake8-annotations-ann "ANN101", # Missing type annotation for 'self' in method. "ANN102", # Missing type annotation for 'cls' in classmethod. # flake8-commas (COM) + # https://docs.astral.sh/ruff/rules/#flake8-commas-com "COM812", # Trailing comma missing. "COM819", # Trailing comma prohibited. # pydocstyle (D) + # https://docs.astral.sh/ruff/rules/undocumented-magic-method/ "D105", # Missing docstring in magic method. # flake8-fixme (FIX) + # https://docs.astral.sh/ruff/rules/line-contains-todo/ "FIX002", # Line contains TODO, consider resolving the issue. - # flake8-implicit-str-concat (ISC) - "ISC001", # Implicitly concatenate string literals on one line. - # pep8-naming + # https://docs.astral.sh/ruff/rules/#pep8-naming-n "N806", # Variable name in function should be lowercase. "N999", # Invalid module name. # pandas-vet (PD) + # https://docs.astral.sh/ruff/rules/#pandas-vet-pd "PD", # Ruff-specific rules (RUF) + # https://docs.astral.sh/ruff/rules/collection-literal-concatenation/ "RUF005", # Consider {expression} instead of concatenation. # flake8-bandit (S) + # https://docs.astral.sh/ruff/rules/assert/ "S101", # Use of assert detected. ] preview = false @@ -163,15 +168,19 @@ max-complexity = 26 [tool.ruff.lint.per-file-ignores] "src/geovista/cli.py" = [ + # https://docs.astral.sh/ruff/rules/print/ "T201", # flake8-print: print found. ] "src/geovista/examples/*.py" = [ + # https://docs.astral.sh/ruff/rules/typing-only-third-party-import/ "TCH002", # flake8-type-checking: Move 3rd-party import into a type checking block. ] "src/geovista/examples/earthquakes.py" = [ + # https://docs.astral.sh/ruff/rules/line-too-long/ "E501", # pycodestyle: Line too long. ] "src/geovista/examples/earthquakes_wink1.py" = [ + # https://docs.astral.sh/ruff/rules/line-too-long/ "E501", # pycodestyle: Line too long. ]