Conversation
WalkthroughRuff linting configuration modified to enable all rules via Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@pyproject.toml`:
- Around line 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.
- Around line 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.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 513c3261-4afa-47df-8ee4-cbc575ea6b53
📒 Files selected for processing (1)
pyproject.toml
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: build-pr
- GitHub Check: Pyright
- GitHub Check: pydocstyle
- GitHub Check: unit_tests (3.12)
- GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-on-pull-request
- GitHub Check: E2E: library mode / ci
- GitHub Check: E2E: server mode / ci
- GitHub Check: E2E Tests for Lightspeed Evaluation job
| 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"] |
There was a problem hiding this comment.
🧩 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:
- 1: https://docs.astral.sh/ruff/settings/
- 2: "ALL" rule selector undocumented astral-sh/ruff#5619
- 3: https://docs.astral.sh/ruff/linter
- 4: Warnings about incompatible rules with
--select ALLastral-sh/ruff#8470 - 5: https://github.com/astral-sh/ruff/releases
- 6: https://github.com/astral-sh/ruff/blob/main/BREAKING_CHANGES.md
🏁 Script executed:
grep -A 5 "ruff" pyproject.toml | head -20Repository: 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.
| 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.
| #extend-select = ["PLW"] | ||
| #extend-select = ["PGH"] | ||
| #extend-select = ["PTH"] | ||
| #extend-select = ["ISC001"] | ||
| #extend-select = ["PIE"] | ||
| #extend-select = ["D"] # hodne automatickych oprav!!! |
There was a problem hiding this comment.
🧹 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.
Description
Type of change
Tools used to create PR
Identify any AI code assistants used in this PR (for transparency and review context)
Related Tickets & Documents
Checklist before requesting a review
Testing
Summary by CodeRabbit