Skip to content

Commit c60a6b6

Browse files
committed
Cleanup ruff config and lint scripts
1 parent 9ac9bad commit c60a6b6

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

pyproject.toml

+5-4
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@ output-format = "colorized"
103103
[tool.pytest.ini_options]
104104
testpaths = "test"
105105

106-
[tool.ruff]
107-
lint.select = [
106+
107+
[tool.ruff.lint]
108+
select = [
108109
"A", # builtins shadowing
109110
"ANN", # annotations
110111
"ASYNC", # async
@@ -126,21 +127,21 @@ lint.select = [
126127
"UP", # pyupgrade
127128
"W", # pydocstyle warning
128129
]
129-
lint.ignore = [
130+
ignore = [
130131
"D202",
131132
"D203",
132133
"D212",
133134
"E501", # line too long
134135
"SIM102", # collapsible-if
135136
"SIM105", #suppressible-exception
136137
]
137-
extend-exclude = ["script"]
138138

139139
[tool.ruff.lint.isort]
140140
force-sort-within-sections = true
141141
combine-as-imports = true
142142

143143
[tool.ruff.lint.per-file-ignores]
144+
"script/*" = ["T20"] # print-used
144145
"test/*" = [
145146
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
146147
"SLF", # private member access

script/refresh_stubs.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Refresh stubs for testing."""
2+
23
import json
4+
from pathlib import Path
35

46
from xknxproject import XKNXProj
57

@@ -24,5 +26,7 @@
2426
)
2527
project = knxproj.parse()
2628

27-
with open(f"test/resources/stubs/{file_name}.json", "w", encoding="utf8") as f:
29+
with Path(f"test/resources/stubs/{file_name}.json").open(
30+
mode="w", encoding="utf8"
31+
) as f:
2832
json.dump(project, f, indent=2, ensure_ascii=False)

0 commit comments

Comments
 (0)