Skip to content

Commit e066232

Browse files
committed
clean up ruff ignores
1 parent 21b3483 commit e066232

File tree

3 files changed

+12
-16
lines changed

3 files changed

+12
-16
lines changed

pyproject.toml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,8 @@ select = [
6262
"PL",
6363
"RUF",
6464
]
65-
ignore = [
66-
"E501", # line too long
67-
"ANN401", # ban Any
68-
"PLR0911", # too many returns
69-
"PLR2004", # magic values
70-
]
65+
# long lines
66+
ignore = [ "E501" ]
7167

7268
[tool.ruff.lint.per-file-ignores]
73-
"tests/test_main.py" = [ "S101", "ANN201"]
74-
"tests/test_profiles.py" = [ "S101", "ANN201"]
75-
"tests/test_desktop.py" = [ "S101", "ANN201"]
76-
"tests/test_choose.py" = [ "S101", "ANN201"]
69+
"tests/test_*.py" = [ "S101", "ANN201"]

src/qbpm/log.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def or_phrase(items: list) -> str:
1616
return "[]"
1717
elif size == 1:
1818
return strings[0]
19-
elif size == 2:
19+
elif size == 2: # noqa: PLR2004
2020
return " or ".join(strings)
2121
else:
2222
return ", or ".join([", ".join(strings[0:-1]), strings[-1]])

src/qbpm/main.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from dataclasses import dataclass
55
from functools import wraps
66
from pathlib import Path
7-
from typing import Any, NoReturn
7+
from typing import Any, NoReturn, TypeVar
88

99
import click
1010

@@ -32,17 +32,20 @@ class CreatorOptions:
3232
overwrite: bool
3333

3434

35-
def creator_options(orig: Callable[..., Any]) -> Callable[..., Any]:
35+
T = TypeVar("T")
36+
37+
38+
def creator_options(orig: Callable[..., T]) -> Callable[..., T]:
3639
@wraps(orig)
3740
def command(
3841
qb_config_dir: Path | None,
3942
launch: bool,
4043
foreground: bool,
4144
desktop_file: bool,
4245
overwrite: bool,
43-
*args: Any,
44-
**kwargs: Any,
45-
) -> Any:
46+
*args: Any, # noqa: ANN401
47+
**kwargs: Any, # noqa: ANN401
48+
) -> T:
4649
return orig(
4750
*args,
4851
c_opts=CreatorOptions(

0 commit comments

Comments
 (0)