Skip to content

Commit

Permalink
Narrow scope with per-file-ignores
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss committed Mar 10, 2023
1 parent c8c2436 commit 25801ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions codespell_lib/_codespell.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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="")
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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
Expand Down

0 comments on commit 25801ce

Please sign in to comment.