Skip to content

Commit ecb380a

Browse files
authored
chore: enable ruff ALL (#705)
Signed-off-by: Henry Schreiner <[email protected]>
1 parent b417ca0 commit ecb380a

File tree

4 files changed

+19
-43
lines changed

4 files changed

+19
-43
lines changed

helpers/cog_cc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def yaml(self) -> str:
3636

3737

3838
class CC:
39-
def __init__(self, filename: str):
39+
def __init__(self, filename: str) -> None:
4040
with Path(filename).open(encoding="utf-8") as f:
4141
data = json.load(f)
4242

helpers/cog_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def render_cookie(**context: str) -> Generator[Path, None, None]:
3030

3131

3232
class Matcher:
33-
def __init__(self, txt: str):
33+
def __init__(self, txt: str) -> None:
3434
self.ast = ast.parse(txt)
3535
self.lines = txt.splitlines()
3636

noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ def nox_session(session: nox.Session, backend: str, vcs: bool, docs: Docs) -> No
364364

365365

366366
@nox.session(default=False)
367-
def compare_copier(session):
367+
def compare_copier(session: nox.Session) -> None:
368368
session.install("cookiecutter", "copier", "copier-templates-extensions")
369369

370370
tmp_dir = session.create_tmp()
@@ -383,7 +383,7 @@ def compare_copier(session):
383383

384384

385385
@nox.session(default=False)
386-
def compare_cruft(session):
386+
def compare_cruft(session: nox.Session) -> None:
387387
session.install("cookiecutter", "cruft")
388388

389389
tmp_dir = session.create_tmp()

pyproject.toml

Lines changed: 15 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -164,48 +164,20 @@ show-fixes = true
164164
extend-exclude = ["\\{\\{cookiecutter.project_name\\}\\}"]
165165

166166
[tool.ruff.lint]
167-
extend-select = [
168-
"ARG", # flake8-unused-arguments
169-
"B", # flake8-bugbear
170-
"BLE", # flake8-blind-except
171-
"C4", # flake8-comprehensions
172-
"DTZ", # flake8-datetimez
173-
"EM", # flake8-errmsg
174-
"EXE", # flake8-executable
175-
"FA", # flake8-future-annotations
176-
"FLY", # flynt
177-
"FURB", # refurb
178-
"G", # flake8-logging-format
179-
"I", # isort
180-
"ICN", # flake8-import-conventions
181-
"ISC", # flake8-implicit-str-concat
182-
"LOG", # flake8-logging
183-
"NPY", # NumPy specific rules
184-
"PD", # pandas-vet
185-
"PERF", # perflint
186-
"PGH", # pygrep-hooks
187-
"PIE", # flake8-pie
188-
"PL", # pylint
189-
"PT", # flake8-pytest-style
190-
"PTH", # flake8-use-pathlib
191-
"PYI", # flake8-pyi
192-
"Q", # flake8-quotes
193-
"RET", # flake8-return
194-
"RSE", # flake8-raise
195-
"RUF", # Ruff-specific
196-
"SIM", # flake8-simplify
197-
"SLOT", # flake8-slots
198-
"T10", # flake8-debugger
199-
"T20", # flake8-print
200-
"TC", # flake8-type-checking
201-
"TID251", # flake8-tidy-imports.banned-api
202-
"TRY", # tryceratops
203-
"UP", # pyupgrade
204-
"YTT", # flake8-2020
205-
]
167+
select = ["ALL"]
206168
ignore = [
169+
"A002", # Okay for arguments to shadow builtins
170+
"A004", # Okay for imports to shadow builtins (like print)
171+
"COM812", # Trailing commas teach the formatter
172+
"D", # Docstrings
173+
"E501", # Line too long
174+
"FBT", # Boolean args fine
175+
"N", # Naming
207176
"PLR", # Design related pylint codes
208177
"RUF012", # Would require a lot of ClassVar's
178+
"S101", # Assert is used by mypy and pytest
179+
"S310", # Okay to open URL
180+
"TID252", # Relative imports are fine
209181
]
210182

211183
[tool.ruff.lint.flake8-tidy-imports.banned-api]
@@ -214,6 +186,10 @@ ignore = [
214186

215187
[tool.ruff.lint.per-file-ignores]
216188
"src/sp_repo_review/_compat/**.py" = ["TID251"]
189+
"src/sp_repo_review/checks/*.py" = ["ERA001"]
190+
"tests/**" = ["ANN", "INP001", "S607"]
191+
"helpers/**" = ["INP001", "FIX004"]
192+
"helpers/extensions.py" = ["ANN"]
217193

218194
[tool.repo-review.ignore]
219195
RTD103 = "Using Ruby instead of Python for docs"

0 commit comments

Comments
 (0)