Skip to content

fix(no_excessive_lines_per_function): expand max_lines Range in NoExcessiveLinesPerFunctionOptions#7714

Merged
ematipico merged 7 commits intobiomejs:mainfrom
MeGaNeKoS:main
Oct 17, 2025
Merged

fix(no_excessive_lines_per_function): expand max_lines Range in NoExcessiveLinesPerFunctionOptions#7714
ematipico merged 7 commits intobiomejs:mainfrom
MeGaNeKoS:main

Conversation

@MeGaNeKoS
Copy link
Contributor

Updated the max_lines field in NoExcessiveLinesPerFunctionOptions to use NonZeroU16 instead of NonZeroU8.
This change increases the maximum configurable number of lines per function, providing greater flexibility for large codebases.

This update improves maintainability for frontend projects (e.g., Next.js) and supports more consistent code style enforcement across teams working with complex components.

@changeset-bot
Copy link

changeset-bot bot commented Oct 8, 2025

🦋 Changeset detected

Latest commit: 162427a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch

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

@MeGaNeKoS MeGaNeKoS changed the title Expand max_lines Range in NoExcessiveLinesPerFunctionOptions fix(no_excessive_lines_per_function): Expand max_lines Range in NoExcessiveLinesPerFunctionOptions Oct 8, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 8, 2025

Walkthrough

Changed the no_excessive_lines_per_function option from an 8‑bit non‑zero type to a 16‑bit non‑zero type: max_lines is now std::num::NonZeroU16 (was NonZeroU8) and its Default uses NonZeroU16::new(50).unwrap(). Release metadata adds patch bumps for several Biome packages and raises the noExcessiveLinesPerFunction ceiling from 255 to 65,535 to support large/JSX frontend files.

Suggested labels

A-Linter

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly and specifically describes the primary change: expanding the maximum configurable lines range in NoExcessiveLinesPerFunctionOptions by updating the underlying numeric type from NonZeroU8 to NonZeroU16. This directly aligns with the changeset, which replaces the import and field type accordingly. The title is concise, avoids vague terminology, and provides enough specificity for a developer to understand the core modification when scanning pull request history.
Description Check ✅ Passed The description is directly related to the changeset and provides meaningful context about the changes. It explains what was modified (the max_lines field type), why the change was made (to increase the configurable limit), and what benefit it provides (greater flexibility for large codebases and improved support for complex frontend components). The description accurately reflects the technical implementation and the practical rationale behind the update.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c018f90 and 162427a.

📒 Files selected for processing (1)
  • .changeset/gold-lamps-try.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/gold-lamps-try.md
⏰ 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). (3)
  • GitHub Check: Test Node.js API
  • GitHub Check: Check JS Files
  • GitHub Check: autofix

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dyc3 dyc3 changed the title fix(no_excessive_lines_per_function): Expand max_lines Range in NoExcessiveLinesPerFunctionOptions fix(no_excessive_lines_per_function): expand max_lines Range in NoExcessiveLinesPerFunctionOptions Oct 8, 2025
Copy link
Contributor

@dyc3 dyc3 left a comment

Choose a reason for hiding this comment

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

There needs to be a changeset for this.

@ematipico
Copy link
Member

@MeGaNeKoS can you please add a changeset?

@MeGaNeKoS
Copy link
Contributor Author

Ok.

MeGaNeKoS and others added 4 commits October 17, 2025 08:02
…eroU8 to NonZeroU16

Updated the max_lines field in NoExcessiveLinesPerFunctionOptions to use NonZeroU16 instead of NonZeroU8. This change allows for a greater range of values for the maximum number of lines allowed in a function body.
Updated the max line option to uint16 (up to 65,535) to prevent JSX/front-end projects from being hindered by the previous 255 line limit. This change ensures better compatibility and flexibility for larger codebases.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b2cc68d and 6ec601c.

⛔ Files ignored due to path filters (1)
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
📒 Files selected for processing (2)
  • .changeset/gold-lamps-try.md (1 hunks)
  • crates/biome_rule_options/src/no_excessive_lines_per_function.rs (2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
.changeset/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

.changeset/*.md: In changesets, only use #### or ##### headers; other header levels are not allowed
Changesets should cover user-facing changes only; internal changes do not need changesets
Use past tense for what you did and present tense for current Biome behavior in changesets
When fixing a bug in a changeset, start with an issue link (e.g., “Fixed #1234: …”)
When referencing a rule or assist in a changeset, include a link to its page on the website
Include code blocks in changesets when applicable to illustrate changes
End every sentence in a changeset with a period

Files:

  • .changeset/gold-lamps-try.md
crates/biome_*/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_rule_options/src/no_excessive_lines_per_function.rs
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Format Rust files before committing (e.g., via just f which formats Rust)
Document rules, assists, and options with inline rustdoc in source

Files:

  • crates/biome_rule_options/src/no_excessive_lines_per_function.rs
🧬 Code graph analysis (1)
crates/biome_rule_options/src/no_excessive_lines_per_function.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (1)
  • NoExcessiveLinesPerFunctionOptions (8013-8026)
🔇 Additional comments (1)
crates/biome_rule_options/src/no_excessive_lines_per_function.rs (1)

3-3: Verified: no range assumptions or breaking changes detected.

The type change from NonZeroU8 to NonZeroU16 is correctly propagated. The rule logic simply counts line tokens and compares against options.max_lines—no hardcoded u8 boundary checks or validation logic were found. Backward compatible since existing configurations with max_lines ≤ 255 remain valid.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@ematipico ematipico merged commit c7e5a14 into biomejs:main Oct 17, 2025
14 checks passed
@github-actions github-actions bot mentioned this pull request Oct 17, 2025
voxxit pushed a commit to voxxit/biome that referenced this pull request Oct 17, 2025
…essiveLinesPerFunctionOptions (biomejs#7714)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants