Skip to content

Commit fc82ec4

Browse files
julian-rischclaude
andauthored
feat: enable ANN ruff ruleset in new integration template (#2978)
Add ANN (flake8-annotations) to the default ruff select list, disable ANN401 (disallow Any) globally since Any is used legitimately at SDK boundaries, and exclude ANN from tests per-file-ignores. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a4a7852 commit fc82ec4

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

scripts/utils/templates/pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ line-length = 120
7878
[tool.ruff.lint]
7979
select = [
8080
"A",
81+
"ANN",
8182
"ARG",
8283
"B",
8384
"C",
@@ -117,6 +118,8 @@ ignore = [
117118
"PLR0912",
118119
"PLR0913",
119120
"PLR0915",
121+
# Allow `Any` type - used legitimately for dynamic types and SDK boundaries
122+
"ANN401",
120123
]
121124

122125
[tool.ruff.lint.isort]
@@ -126,8 +129,8 @@ known-first-party = ["haystack_integrations"]
126129
ban-relative-imports = "parents"
127130

128131
[tool.ruff.lint.per-file-ignores]
129-
# Tests can use magic values, assertions, and relative imports
130-
"tests/**/*" = ["PLR2004", "S101", "TID252"]
132+
# Tests can use magic values, assertions, relative imports, and don't need type annotations
133+
"tests/**/*" = ["PLR2004", "S101", "TID252", "ANN"]
131134

132135
[tool.coverage.run]
133136
source = ["haystack_integrations"]

0 commit comments

Comments
 (0)