diff --git a/codespell_lib/_codespell.py b/codespell_lib/_codespell.py index dadb575378..f2c6c44cb6 100644 --- a/codespell_lib/_codespell.py +++ b/codespell_lib/_codespell.py @@ -26,7 +26,7 @@ from typing import Dict, List, Match, Optional, Pattern, Sequence, Set, Tuple # autogenerated by setuptools_scm -from ._version import __version__ as VERSION +from ._version import __version__ as VERSION # noqa: N812 word_regex_def = "[\\w\\-'’`]+" # While we want to treat characters like ( or " as okay for a starting break, @@ -228,7 +228,7 @@ def open_with_chardet(self, filename: str) -> Tuple[List[str], str]: break self.encdetector.close() encoding = self.encdetector.result["encoding"] - assert encoding is not None + assert encoding is not None # noqa: S101 try: f = open(filename, encoding=encoding, newline="") diff --git a/pyproject.toml b/pyproject.toml index 99f14e7707..5944a2db79 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,14 +103,9 @@ addopts = "--cov=codespell_lib -rs --cov-report= --tb=short --junit-xml=junit-re [tool.ruff] extend-ignore = [ - "A003", "ANN101", - "ANN401", "B904", - "N802", - "N812", "PLW2901", - "S101", ] line-length = 88 select = [ @@ -137,6 +132,11 @@ target-version = "py37" [tool.ruff.mccabe] max-complexity = 45 +[tool.ruff.per-file-ignores] +"codespell_lib/_codespell.py" = ["A003"] +"codespell_lib/tests/test_*" = ["S101"] +"codespell_lib/tests/test_basic.py" = ["ANN401", "N802"] + [tool.ruff.pylint] allow-magic-value-types = ["bytes", "int", "str",] max-args = 12