Skip to content

Commit 167b495

Browse files
committed
fix: restore ruff baseline ignores for hatch fmt CI compatibility
1 parent 9584136 commit 167b495

1 file changed

Lines changed: 75 additions & 22 deletions

File tree

pyproject.toml

Lines changed: 75 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -165,37 +165,90 @@ exclude_lines = [
165165
target-version = "py310"
166166

167167
[tool.ruff.lint]
168-
# Project-wide style choices and pragmatic suppressions.
169-
# Rules removed from the original baseline are now enforced.
168+
# Baseline suppressions carried from the original codebase.
169+
# Many of these fire in pre-existing MCP server code or reflect
170+
# deliberate style choices. Rules can be tightened incrementally.
170171
ignore = [
171-
# Style choices — these are deliberate project conventions
172-
"EM101", # Exception string literals (pragmatic for this codebase)
173-
"EM102", # Exception f-strings (pragmatic for this codebase)
174-
"G004", # Logging f-strings (clearer than % formatting)
175-
"T201", # print() used intentionally for user output
176-
"TRY003", # Raise with inline message strings (pragmatic)
172+
# Style choices — deliberate project conventions
173+
"EM101", # Exception string literals
174+
"EM102", # Exception f-strings
175+
"G004", # Logging f-strings
176+
"T201", # print() used for user output
177+
"TRY003", # Raise with inline message strings
177178

178179
# Backwards-compatibility suppressions for existing code
179-
"A001", # Variable shadows built-in (existing API names)
180-
"A002", # Argument shadows built-in (existing API signatures)
181-
"FBT001", # Boolean positional arg (existing API)
182-
"FBT002", # Boolean default value (existing API)
183-
"N802", # Function name casing (existing API: get_AI_endpoint etc.)
184-
"N806", # Variable casing (existing code conventions)
185-
"SLF001", # Private member access (needed for MCP wrapper internals)
180+
"A001", # Variable shadows built-in
181+
"A002", # Argument shadows built-in
182+
"A004", # Import shadows built-in
183+
"FBT001", # Boolean positional arg
184+
"FBT002", # Boolean default value
185+
"N801", # Class name casing
186+
"N802", # Function name casing
187+
"N806", # Variable casing
188+
"N818", # Exception name suffix
189+
"SLF001", # Private member access (MCP internals)
186190

187191
# Framework / ecosystem constraints
188-
"ARG001", # Unused function argument (required by hook/callback signatures)
189-
"B023", # Function uses loop variable (async closures in runner)
190-
"INP001", # Implicit namespace package (project uses src layout)
191-
"PLW2901", # Outer loop variable overwritten (iteration patterns)
192-
"S701", # Jinja2 autoescape=False (YAML context, not HTML)
192+
"ARG001", # Unused function argument (hook/callback signatures)
193+
"B023", # Function uses loop variable (async closures)
194+
"INP001", # Implicit namespace package (src layout)
195+
"PLW2901", # Outer loop variable overwritten
196+
"S701", # Jinja2 autoescape=False (YAML, not HTML)
197+
"TID252", # Relative imports from parent modules
193198

194-
# Low-signal rules for this project
199+
# Import organisation (deferred imports used for cycle-breaking)
200+
"I001", # Import block unsorted
201+
"PLC0414", # Useless import alias (intentional re-exports)
202+
"PLC0415", # Import not at top-level (deferred imports)
203+
204+
# Exception handling patterns
205+
"B904", # raise without from in except
206+
"BLE001", # Blind except (Exception)
207+
"TRY004", # Prefer TypeError
208+
"TRY300", # try-except-return
209+
"TRY301", # Abstract raise to inner function
210+
"TRY400", # logging.exception vs logging.error
211+
212+
# Typing / annotation style
213+
"FA100", # Missing from __future__ import annotations
214+
"FA102", # Missing annotations import in stub
215+
"PYI036", # __exit__ signature
216+
"PYI041", # Use float instead of int | float
217+
"TC001", # Move import into TYPE_CHECKING
218+
"TC002", # Move import into TYPE_CHECKING
219+
"TC003", # Move import into TYPE_CHECKING
220+
"UP006", # Use X | Y for isinstance
221+
"UP007", # Use X | Y union type
222+
"UP035", # Import from collections.abc
223+
"UP045", # Use X | None
224+
225+
# Low-signal or noisy rules
226+
"B006", # Mutable default argument (pre-existing in MCP servers)
227+
"B007", # Unused loop control variable
228+
"B008", # Function call in argument defaults
229+
"C416", # Unnecessary comprehension
230+
"LOG015", # Root logger usage
231+
"PERF102", # Use keys()/values() instead of items()
195232
"PLR2004", # Magic value comparisons
233+
"PLW0602", # Global variable not assigned
234+
"PLW0603", # Using global statement
235+
"PLW1508", # Invalid envvar default
236+
"PT011", # pytest.raises too broad
196237
"RET503", # Missing explicit return
238+
"RET504", # Unnecessary assignment before return
197239
"RET505", # Unnecessary else after return
198-
"SIM102", # Collapsible if (readability preference)
240+
"RSE102", # Unnecessary parentheses on raised exception
241+
"RUF005", # Unpack instead of concatenation
242+
"RUF022", # __all__ not sorted
243+
"RUF023", # __slots__ not sorted
244+
"RUF059", # Unused unpacked variable
245+
"RUF100", # Unused noqa directive
246+
"S108", # Hardcoded temp file
247+
"S607", # Partial path to executable
248+
"SIM102", # Collapsible if
249+
"SIM115", # Use context handler for file
250+
"SIM210", # Use ternary operator
251+
"UP015", # Unnecessary open mode
199252
]
200253

201254
[tool.ruff.lint.per-file-ignores]

0 commit comments

Comments
 (0)