Conversation
|
WalkthroughThe fix_all logic in crates/biome_service/src/file_handlers/css.rs was adjusted so that FixFileMode::SafeAndUnsafeFixes now skips suppression actions, matching the behaviour of SafeFixes. Suppression actions are ignored in both modes, with no changes to error counting or mutation logic. No public or exported declarations were modified. Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
crates/biome_service/src/file_handlers/css.rs (1)
715-718: Fix correctly addresses the regression.The logic now properly skips suppression actions in
SafeAndUnsafeFixesmode, matching the behaviour inSafeFixes. This resolves the regression as intended.However, the identical suppression check now appears in both branches (lines 703–705 and 715–718). Consider extracting this into a helper or restructuring the match arms to reduce duplication:
for action in signal.actions() { + // Suppression actions should not be part of safe or unsafe fixes + if !matches!(params.fix_file_mode, FixFileMode::ApplySuppressions) + && action.is_suppression() + { + continue; + } + match params.fix_file_mode { FixFileMode::SafeFixes => { - // suppression actions should not be part of safe fixes - if action.is_suppression() { - continue; - } if action.applicability == Applicability::MaybeIncorrect { skipped_suggested_fixes += 1; } if action.applicability == Applicability::Always { errors = errors.saturating_sub(1); return ControlFlow::Break(action); } } FixFileMode::SafeAndUnsafeFixes => { - // suppression actions should not be part of safe fixes - if action.is_suppression() { - continue; - } if matches!( action.applicability, Applicability::Always | Applicability::MaybeIncorrect ) { errors = errors.saturating_sub(1); return ControlFlow::Break(action); } } FixFileMode::ApplySuppressions => { if action.is_suppression() { return ControlFlow::Break(action); } } } }Minor: The comment at line 715 mentions "safe fixes" but sits in the
SafeAndUnsafeFixesbranch—consider "safe or unsafe fixes" for precision.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
crates/biome_service/src/file_handlers/css.rs(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_service/src/file_handlers/css.rs
**/*.{rs,toml}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Before committing, format Rust and TOML files (e.g., via
just f/just format)
Files:
crates/biome_service/src/file_handlers/css.rs
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Document rules, assists, and options via inline rustdoc in Rust source
Files:
crates/biome_service/src/file_handlers/css.rs
⏰ 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). (7)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Documentation
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Check Dependencies
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: autofix
Summary
My last PR introduced a regression. This PR fixes it
Test Plan
The previous failing test
should_apply_fixes_to_embedded_languagesshould passDocs