diff --git a/helpers/cog_cc.py b/helpers/cog_cc.py index 867d103f..7848af75 100644 --- a/helpers/cog_cc.py +++ b/helpers/cog_cc.py @@ -36,7 +36,7 @@ def yaml(self) -> str: class CC: - def __init__(self, filename: str): + def __init__(self, filename: str) -> None: with Path(filename).open(encoding="utf-8") as f: data = json.load(f) diff --git a/helpers/cog_helpers.py b/helpers/cog_helpers.py index 36112f2a..bfc68202 100644 --- a/helpers/cog_helpers.py +++ b/helpers/cog_helpers.py @@ -30,7 +30,7 @@ def render_cookie(**context: str) -> Generator[Path, None, None]: class Matcher: - def __init__(self, txt: str): + def __init__(self, txt: str) -> None: self.ast = ast.parse(txt) self.lines = txt.splitlines() diff --git a/noxfile.py b/noxfile.py index 3bf41054..6c55c366 100755 --- a/noxfile.py +++ b/noxfile.py @@ -364,7 +364,7 @@ def nox_session(session: nox.Session, backend: str, vcs: bool, docs: Docs) -> No @nox.session(default=False) -def compare_copier(session): +def compare_copier(session: nox.Session) -> None: session.install("cookiecutter", "copier", "copier-templates-extensions") tmp_dir = session.create_tmp() @@ -383,7 +383,7 @@ def compare_copier(session): @nox.session(default=False) -def compare_cruft(session): +def compare_cruft(session: nox.Session) -> None: session.install("cookiecutter", "cruft") tmp_dir = session.create_tmp() diff --git a/pyproject.toml b/pyproject.toml index 2d27a4fa..6783a099 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -164,48 +164,20 @@ show-fixes = true extend-exclude = ["\\{\\{cookiecutter.project_name\\}\\}"] [tool.ruff.lint] -extend-select = [ - "ARG", # flake8-unused-arguments - "B", # flake8-bugbear - "BLE", # flake8-blind-except - "C4", # flake8-comprehensions - "DTZ", # flake8-datetimez - "EM", # flake8-errmsg - "EXE", # flake8-executable - "FA", # flake8-future-annotations - "FLY", # flynt - "FURB", # refurb - "G", # flake8-logging-format - "I", # isort - "ICN", # flake8-import-conventions - "ISC", # flake8-implicit-str-concat - "LOG", # flake8-logging - "NPY", # NumPy specific rules - "PD", # pandas-vet - "PERF", # perflint - "PGH", # pygrep-hooks - "PIE", # flake8-pie - "PL", # pylint - "PT", # flake8-pytest-style - "PTH", # flake8-use-pathlib - "PYI", # flake8-pyi - "Q", # flake8-quotes - "RET", # flake8-return - "RSE", # flake8-raise - "RUF", # Ruff-specific - "SIM", # flake8-simplify - "SLOT", # flake8-slots - "T10", # flake8-debugger - "T20", # flake8-print - "TC", # flake8-type-checking - "TID251", # flake8-tidy-imports.banned-api - "TRY", # tryceratops - "UP", # pyupgrade - "YTT", # flake8-2020 -] +select = ["ALL"] ignore = [ + "A002", # Okay for arguments to shadow builtins + "A004", # Okay for imports to shadow builtins (like print) + "COM812", # Trailing commas teach the formatter + "D", # Docstrings + "E501", # Line too long + "FBT", # Boolean args fine + "N", # Naming "PLR", # Design related pylint codes "RUF012", # Would require a lot of ClassVar's + "S101", # Assert is used by mypy and pytest + "S310", # Okay to open URL + "TID252", # Relative imports are fine ] [tool.ruff.lint.flake8-tidy-imports.banned-api] @@ -214,6 +186,10 @@ ignore = [ [tool.ruff.lint.per-file-ignores] "src/sp_repo_review/_compat/**.py" = ["TID251"] +"src/sp_repo_review/checks/*.py" = ["ERA001"] +"tests/**" = ["ANN", "INP001", "S607"] +"helpers/**" = ["INP001", "FIX004"] +"helpers/extensions.py" = ["ANN"] [tool.repo-review.ignore] RTD103 = "Using Ruby instead of Python for docs"