Skip to content

Commit 218c88e

Browse files
Apply Repo-Review suggestions
1 parent f6a0fcb commit 218c88e

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

codespell_lib/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from ._codespell import _script_main, main
2-
from ._version import __version__ # type: ignore
2+
from ._version import __version__ # type: ignore[import-not-found]
33

44
__all__ = ["_script_main", "main", "__version__"]

codespell_lib/_codespell.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
from typing import Any, Dict, List, Match, Optional, Pattern, Sequence, Set, Tuple
2727

2828
# autogenerated by setuptools_scm
29-
from ._version import __version__ as VERSION # type: ignore # noqa: N812
29+
from ._version import ( # type: ignore[import-not-found]
30+
__version__ as VERSION, # noqa: N812
31+
)
3032

3133
word_regex_def = r"[\w\-'’]+"
3234
# While we want to treat characters like ( or " as okay for a starting break,

pyproject.toml

+15-8
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,24 @@ codespell_lib = [
9292

9393
[tool.mypy]
9494
pretty = true
95-
show_error_codes = true
95+
hide_error_codes = false
9696
strict = true
9797
warn_unused_ignores = false
98+
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
9899

99100
[tool.pytest.ini_options]
100-
addopts = "--cov=codespell_lib -rs --cov-report= --tb=short --junit-xml=junit-results.xml"
101+
minversion = "7"
102+
testpaths = ["codespell_lib/tests"]
103+
log_cli_level = "INFO"
104+
xfail_strict = true
105+
addopts = ["--cov=codespell_lib", "-rs", "--strict-config", "--strict-markers", "--cov-report=", "--tb=short", "--junit-xml=junit-results.xml"]
106+
filterwarnings = ["error"]
101107

102108
[tool.ruff]
103-
extend-ignore = [
109+
line-length = 88
110+
111+
[tool.ruff.lint]
112+
ignore = [
104113
"ANN101",
105114
"B904",
106115
"PLW2901",
@@ -120,7 +129,6 @@ extend-ignore = [
120129
"ISC001",
121130
"ISC002",
122131
]
123-
line-length = 88
124132
select = [
125133
"A",
126134
"ANN",
@@ -141,17 +149,16 @@ select = [
141149
"W",
142150
"YTT",
143151
]
144-
target-version = "py37"
145152

146-
[tool.ruff.mccabe]
153+
[tool.ruff.lint.mccabe]
147154
max-complexity = 45
148155

149-
[tool.ruff.per-file-ignores]
156+
[tool.ruff.lint.per-file-ignores]
150157
"codespell_lib/_codespell.py" = ["A003"]
151158
"codespell_lib/tests/test_*" = ["S101"]
152159
"codespell_lib/tests/test_basic.py" = ["ANN401", "N802"]
153160

154-
[tool.ruff.pylint]
161+
[tool.ruff.lint.pylint]
155162
allow-magic-value-types = ["bytes", "int", "str",]
156163
max-args = 12
157164
max-branches = 49

0 commit comments

Comments
 (0)