feat(lint/html): port noExcessiveLinesPerFile to html#9967
Conversation
🦋 Changeset detectedLatest commit: 8ce06e1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (13)
✅ Files skipped from review due to trivial changes (8)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughAdds an HTML nursery lint rule Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 `@crates/biome_console/src/fmt.rs`:
- Around line 222-233: The new impl_std_display! expansions for NonZeroI8,
NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI128, NonZeroIsize, NonZeroU8,
NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU128, and NonZeroUsize need unit
tests: add a compact test in the same crate (e.g., in
crates/biome_console/src/fmt.rs tests module or a new tests file) that
constructs representative NonZero signed and unsigned values (positive and
negative where applicable) and asserts their Display output matches the expected
string via format!("{}", value) or value.to_string(); include edge cases like
minimum non-zero (e.g., -1 for signed) and a large value for big types to ensure
all macro-generated impls behave correctly.
In `@crates/biome_html_analyze/src/lint/nursery/no_excessive_lines_per_file.rs`:
- Around line 43-54: Update the option docs for the no_excessive_lines_per_file
rule by adding a short example snippet under each option section: for the ###
`maxLines` section add an example showing a small file that exceeds the default
(e.g., default 300) and the configuration snippet demonstrating how to set
"maxLines" with the resulting diagnostic, and for the ### `skipBlankLines`
section add an example showing a file with many blank lines where setting
"skipBlankLines": true prevents a diagnostic (plus the config snippet). Ensure
each option section keeps its header, description, Default line, and now an
Examples subsection consistent with other rule-doc conventions and referencing
the `maxLines` and `skipBlankLines` option names.
🪄 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: CHILL
Plan: Pro
Run ID: 4c6f0dc9-f7cc-42e6-ac21-1f1477e9f8ff
⛔ Files ignored due to path filters (3)
crates/biome_html_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.html.snapis excluded by!**/*.snapand included by**crates/biome_html_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.html.snapis excluded by!**/*.snapand included by**crates/biome_html_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.html.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (13)
.changeset/gentle-stars-do.mdcrates/biome_console/src/fmt.rscrates/biome_css_analyze/src/lint/nursery/no_excessive_lines_per_file.rscrates/biome_graphql_analyze/src/lint/nursery/no_excessive_lines_per_file.rscrates/biome_html_analyze/src/lint/nursery/no_excessive_lines_per_file.rscrates/biome_html_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.htmlcrates/biome_html_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalid.options.jsoncrates/biome_html_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.htmlcrates/biome_html_analyze/tests/specs/nursery/noExcessiveLinesPerFile/invalidSkipBlankLines.options.jsoncrates/biome_html_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.htmlcrates/biome_html_analyze/tests/specs/nursery/noExcessiveLinesPerFile/valid.options.jsoncrates/biome_js_analyze/src/lint/complexity/no_excessive_lines_per_function.rscrates/biome_js_analyze/src/lint/nursery/no_excessive_lines_per_file.rs
Merging this PR will not alter performance
Comparing Footnotes
|
ematipico
left a comment
There was a problem hiding this comment.
Please accept the regression before merging (it's expected)
ematipico
left a comment
There was a problem hiding this comment.
Forgot. This is a minor, it must be merged into next
12ce978 to
963a0c5
Compare
920d665 to
dda268e
Compare
dda268e to
8ce06e1
Compare
Summary
This ports the noExcessiveLinesPerFile rule to HTML.
Also tried to reduce some string allocations in the other implementations.
Test Plan
snapshots
Docs