Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply Repo-Review suggestions #3265

Merged
merged 2 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion codespell_lib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ._codespell import _script_main, main
from ._version import __version__ # type: ignore
from ._version import __version__ # type: ignore[import-not-found]

__all__ = ["_script_main", "main", "__version__"]
4 changes: 3 additions & 1 deletion codespell_lib/_codespell.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
from typing import Any, Dict, List, Match, Optional, Pattern, Sequence, Set, Tuple

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

word_regex_def = r"[\w\-'’]+"
# While we want to treat characters like ( or " as okay for a starting break,
Expand Down
23 changes: 15 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,24 @@ codespell_lib = [

[tool.mypy]
pretty = true
show_error_codes = true
hide_error_codes = false
strict = true
warn_unused_ignores = false
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]

[tool.pytest.ini_options]
addopts = "--cov=codespell_lib -rs --cov-report= --tb=short --junit-xml=junit-results.xml"
minversion = "6"
testpaths = ["codespell_lib/tests"]
log_cli_level = "INFO"
xfail_strict = true
addopts = ["--cov=codespell_lib", "-rs", "--strict-config", "--strict-markers", "--cov-report=", "--tb=short", "--junit-xml=junit-results.xml"]
filterwarnings = ["error"]

[tool.ruff]
extend-ignore = [
line-length = 88

[tool.ruff.lint]
ignore = [
"ANN101",
"B904",
"PLW2901",
Expand All @@ -120,7 +129,6 @@ extend-ignore = [
"ISC001",
"ISC002",
]
line-length = 88
select = [
"A",
"ANN",
Expand All @@ -141,17 +149,16 @@ select = [
"W",
"YTT",
]
target-version = "py37"

[tool.ruff.mccabe]
[tool.ruff.lint.mccabe]
max-complexity = 45

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"codespell_lib/_codespell.py" = ["A003"]
"codespell_lib/tests/test_*" = ["S101"]
"codespell_lib/tests/test_basic.py" = ["ANN401", "N802"]

[tool.ruff.pylint]
[tool.ruff.lint.pylint]
allow-magic-value-types = ["bytes", "int", "str",]
max-args = 12
max-branches = 49
Expand Down