Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,14 @@ disable = ["R0801"]
extend-exclude = ["tests/profiles/syntax_error.py"]

[tool.ruff.lint]
extend-select = ["TID251", "UP006", "UP007", "UP010", "UP017", "UP035", "RUF100", "B009", "B010", "DTZ005", "D202", "I001"]
extend-select = ["ALL"]
#extend-select = ["PLW"]
#extend-select = ["PGH"]
#extend-select = ["PTH"]
#extend-select = ["ISC001"]
#extend-select = ["PIE"]
#extend-select = ["D"] # hodne automatickych oprav!!!
Comment on lines +230 to +235
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Remove commented alternative Ruff configs to reduce ambiguity.

Lines 230-235 look like stale toggle options and make the active policy harder to read/review. Keep only the effective configuration.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pyproject.toml` around lines 230 - 235, Remove the stale commented
alternative Ruff config lines (the commented extend-select entries like "PLW",
"PGH", "PTH", "ISC001", "PIE", "D") so the pyproject.toml contains only the
active/intentional Ruff configuration; locate the block where extend-select is
configured (the commented lines shown) and delete the redundant commented
options, leaving a single clear extend-select setting (or none if you intend
default behavior) and optionally replace the block with a concise comment
explaining the chosen policy.

ignore = ["UP045", "S101", "E501", "COM812"]
Comment on lines +229 to +236
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

For Ruff (version around 0.11.x and latest docs), does extend-select = ["ALL"] enable newly added rules on future upgrades, and what is Ruff's recommended approach for stable CI configurations?

💡 Result:

No, extend-select = ["ALL"] does not enable newly added rules on future upgrades. Ruff's ["ALL"] selector enables all rules available in the current version of Ruff at the time of execution. New rules added in future Ruff versions (e.g., after upgrading from 0.11.x to 0.15.x) are not automatically enabled by ["ALL"] unless explicitly selected via prefixes or codes; ["ALL"] only covers existing rules. Ruff's recommended approach for stable CI configurations is to use explicit select (not extend-select) with specific rule prefixes or categories (e.g., select = ["E4", "E7", "E9", "F", "B"]), combined with ignore for exclusions. This makes the rule set explicit and reproducible across Ruff upgrades, avoiding surprises from new rules. Ruff explicitly advises: "Prefer select and ignore over extend-select and extend-ignore, to make your rule set explicit" and "Use ALL with discretion. Enabling ALL will implicitly enable new rules whenever you upgrade." Start small (e.g., defaults like E4, E7, E9, F) and add categories incrementally. ["ALL"] is intentionally under-documented as an anti-pattern for stable configs.

Citations:


🏁 Script executed:

grep -A 5 "ruff" pyproject.toml | head -20

Repository: lightspeed-core/lightspeed-stack

Length of output: 610


extend-select = ["ALL"] violates Ruff's best practice guidance for explicit rule configuration.

Using extend-select = ["ALL"] is discouraged by Ruff. The tool's own documentation states: "Prefer select and ignore over extend-select and extend-ignore, to make your rule set explicit" and explicitly warns "Use ALL with discretion." Replace with an explicit select list of rule prefixes to maintain a reproducible, maintainable configuration across versions.

Suggested fix
 [tool.ruff.lint]
-extend-select = ["ALL"]
-#extend-select = ["PLW"]
-#extend-select = ["PGH"]
-#extend-select = ["PTH"]
-#extend-select = ["ISC001"]
-#extend-select = ["PIE"]
-#extend-select = ["D"]   # hodne automatickych oprav!!!
+select = [
+    "B", "C4", "COM", "D", "E", "F", "I", "N", "PIE", "PL", "PTH", "RUF", "S", "SIM", "UP", "W"
+]
 ignore = ["UP045", "S101", "E501", "COM812"]

Also remove the commented-out extend-select alternatives (lines 230–235) to reduce configuration clutter.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
extend-select = ["ALL"]
#extend-select = ["PLW"]
#extend-select = ["PGH"]
#extend-select = ["PTH"]
#extend-select = ["ISC001"]
#extend-select = ["PIE"]
#extend-select = ["D"] # hodne automatickych oprav!!!
ignore = ["UP045", "S101", "E501", "COM812"]
[tool.ruff.lint]
select = [
"B", "C4", "COM", "D", "E", "F", "I", "N", "PIE", "PL", "PTH", "RUF", "S", "SIM", "UP", "W"
]
ignore = ["UP045", "S101", "E501", "COM812"]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pyproject.toml` around lines 229 - 236, Replace the broad extend-select =
["ALL"] with an explicit select list of Ruff rule prefixes (use the select key
instead of extend-select, e.g., select = ["E","F","W","C","I","S","P"] or the
exact prefixes your project needs) and keep the existing ignore = [...] as-is;
also remove the commented-out extend-select alternatives (the commented lines
beginning with `#extend-select`) to reduce clutter and make the rule set explicit
and reproducible.


[tool.ruff.lint.flake8-tidy-imports.banned-api]
unittest = { msg = "use pytest instead of unittest" }
Expand Down
Loading