-
-
Notifications
You must be signed in to change notification settings - Fork 717
feat: add 'auto' mode to lineEndings #7599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 65f309f 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 |
544b595
to
1603f0f
Compare
Thank you |
1603f0f
to
d85ad41
Compare
CodSpeed Performance ReportMerging #7599 will not alter performanceComparing Summary
|
Caution Review failedThe pull request is closed. WalkthroughAdds a platform-aware Possibly related PRs
Suggested labels
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (3)
crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/line_ending.js (1)
1-17
: Fixture looks fine; tiny nit for robustness.Consider ensuring there’s a terminal newline to make the line‑ending assertion unambiguous on all platforms, and keep the fixture minimal (one or two lines is enough) to avoid noisy diffs in future. Happy as-is if you prefer.
crates/biome_formatter/src/lib.rs (2)
150-173
: Auto variant looks good; consider keepingas_str
const to avoid needless breakage.
- The new
LineEnding::Auto
and parsing/formatting are sensible. 👍- You dropped
as_str
fromconst
to non‑const. If MSRV allows, you can keep itconst
even withAuto
usingcfg!
or#[cfg]
blocks, preserving any const‑context uses and reducing the surface of the major bump.Suggested change:
- pub fn as_str(&self) -> &'static str { + pub const fn as_str(&self) -> &'static str { match self { Self::Lf => "\n", Self::Crlf => "\r\n", Self::Cr => "\r", - Self::Auto => { - #[cfg(windows)] - { - "\r\n" - } - #[cfg(not(windows))] - { - "\n" - } - } + Self::Auto => { + if cfg!(windows) { "\r\n" } else { "\n" } + } } }If MSRV or CI objects to
const
here, ignore this suggestion.Also applies to: 190-194, 199-208, 211-219
141-149
: Minor docs nit.“inside git repos” → “inside Git repositories” for brand/style consistency.
- /// Line Feed only (\n), common on Linux and macOS as well as inside git repos + /// Line Feed only (\n), common on Linux and macOS as well as inside Git repositories.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (6)
crates/biome_cli/tests/snapshots/main_commands_check/check_help.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_ci/ci_help.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_format/format_help.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/line_ending.js.snap
is excluded by!**/*.snap
and included by**
packages/@biomejs/backend-jsonrpc/src/workspace.ts
is excluded by!**/backend-jsonrpc/src/workspace.ts
and included by**
packages/@biomejs/biome/configuration_schema.json
is excluded by!**/configuration_schema.json
and included by**
📒 Files selected for processing (8)
.changeset/warm-insects-dress.md
(1 hunks)crates/biome_configuration/src/formatter.rs
(1 hunks)crates/biome_configuration/src/overrides.rs
(1 hunks)crates/biome_formatter/src/lib.rs
(4 hunks)crates/biome_formatter/src/printer/mod.rs
(1 hunks)crates/biome_formatter_test/src/spec.rs
(1 hunks)crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/line_ending.js
(1 hunks)crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/options.json
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_formatter/src/printer/mod.rs
crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/options.json
crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/line_ending.js
crates/biome_formatter_test/src/spec.rs
crates/biome_formatter/src/lib.rs
crates/biome_configuration/src/overrides.rs
crates/biome_configuration/src/formatter.rs
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Format all Rust source files before committing (just f)
Files:
crates/biome_formatter/src/printer/mod.rs
crates/biome_formatter_test/src/spec.rs
crates/biome_formatter/src/lib.rs
crates/biome_configuration/src/overrides.rs
crates/biome_configuration/src/formatter.rs
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**
📄 CodeRabbit inference engine (CLAUDE.md)
Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}
Files:
crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/options.json
crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/line_ending.js
**/tests/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place test files under a tests/ directory in each crate
Files:
crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/options.json
crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/line_ending.js
crates/biome_configuration/src/**
📄 CodeRabbit inference engine (CLAUDE.md)
Keep configuration sources under biome_configuration/src/
Files:
crates/biome_configuration/src/overrides.rs
crates/biome_configuration/src/formatter.rs
.changeset/*.md
📄 CodeRabbit inference engine (CONTRIBUTING.md)
.changeset/*.md
: In changeset files, only use #### or ##### headers; avoid other header levels
Changeset descriptions should use past tense for what you did (e.g., "Added...")
Describe current Biome behavior in present tense within changesets (e.g., "Biome now supports...")
For bug fixes in changesets, start with a link to the issue (e.g., "Fixed #1234: ...")
When referencing rules or assists in changesets, include links to their documentation pages
Include a minimal code block in the changeset when applicable to demonstrate the change
End every sentence in the changeset description with a period
Files:
.changeset/warm-insects-dress.md
🧠 Learnings (8)
📚 Learning: 2025-08-11T11:48:27.774Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.774Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/language.rs : Create tests/language.rs defining HtmlTestFormatLanguage and implement TestFormatLanguage for it
Applied to files:
crates/biome_formatter/src/printer/mod.rs
crates/biome_formatter_test/src/spec.rs
📚 Learning: 2025-08-11T11:48:27.774Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.774Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/spec_test.rs : Create tests/spec_test.rs implementing the run(spec_input_file, _expected_file, test_directory, _file_type) function as shown and include!("language.rs")
Applied to files:
crates/biome_formatter/src/printer/mod.rs
crates/biome_formatter_test/src/spec.rs
📚 Learning: 2025-09-13T16:16:06.459Z
Learnt from: ematipico
PR: biomejs/biome#7467
File: crates/biome_service/src/file_handlers/html.rs:456-466
Timestamp: 2025-09-13T16:16:06.459Z
Learning: In biome_formatter, consecutive LineMode::Hard elements are automatically collapsed to a single newline by the printer. The printer has a test "it_prints_consecutive_hard_lines_as_one" that demonstrates this behavior - multiple consecutive hard line breaks result in only one newline in the output, not extra blank lines.
Applied to files:
crates/biome_formatter/src/printer/mod.rs
📚 Learning: 2025-08-11T11:48:27.774Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.774Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/spec_tests.rs : Create tests/spec_tests.rs in the biome_html_formatter crate that generates tests via tests_macros::gen_tests! for all HTML files at tests/specs/html/**/*.html
Applied to files:
crates/biome_formatter/src/printer/mod.rs
📚 Learning: 2025-08-17T08:55:30.118Z
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-17T08:55:30.118Z
Learning: Applies to crates/biome_html_formatter/benches/html_formatter.rs : Maintain the HTML formatter benchmark at benches/html_formatter.rs within the biome_html_formatter crate
Applied to files:
crates/biome_formatter/src/printer/mod.rs
📚 Learning: 2025-08-11T11:48:27.774Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.774Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/specs/html/**/options.json : When non-default formatting options are needed for a test group, place an options.json (biome.json format) alongside the .html files in that folder
Applied to files:
crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/options.json
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
PR: biomejs/biome#7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.
Applied to files:
crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/options.json
📚 Learning: 2025-09-07T17:35:00.517Z
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-09-07T17:35:00.517Z
Learning: Applies to .changeset/*.md : Describe current Biome behavior in present tense within changesets (e.g., "Biome now supports...")
Applied to files:
.changeset/warm-insects-dress.md
🧬 Code graph analysis (1)
crates/biome_formatter/src/printer/mod.rs (2)
crates/biome_formatter/src/lib.rs (1)
as_code
(1018-1020)crates/biome_formatter/src/builders.rs (2)
block_indent
(1189-1194)hard_line_break
(99-101)
🔇 Additional comments (5)
crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/options.json (1)
1-6
: LGTM! Clean test configuration.The test configuration correctly follows the established pattern for formatter test options and properly references the schema. Based on learnings.
crates/biome_configuration/src/formatter.rs (1)
43-43
: LGTM! CLI argument extended correctly.The addition of "auto" to the line-ending argument options is consistent with the new LineEnding::Auto variant.
crates/biome_formatter/src/printer/mod.rs (1)
1513-1544
: LGTM! Comprehensive test for Auto line endings.The test properly validates OS-dependent behaviour with appropriate conditional compilation. The structure follows existing patterns and expectations align with the Auto semantics.
crates/biome_configuration/src/overrides.rs (1)
145-145
: LGTM! Override configuration consistency maintained.The addition of "auto" to the override line-ending options maintains consistency with the main formatter configuration.
crates/biome_formatter_test/src/spec.rs (1)
273-281
: LGTM! Sensible conditional normalisation.The logic correctly preserves platform-specific behaviour in snapshots when auto line endings are used, whilst maintaining existing normalisation for explicit line ending choices. Clear comment explains the reasoning well.
Thank you @anaisbetts We will review the PR soon. In the meantime, can you send the PR against the |
2ef176d
to
e7d1ea6
Compare
72d28ff
to
7a5cfb6
Compare
@coderabbitai generate docstrings |
✅ Actions performedDocstrings generation started. |
Docstrings generation was requested by @anaisbetts. * #7599 (comment) The following files were modified: * `crates/biome_formatter/src/lib.rs` * `crates/biome_formatter_test/src/spec.rs`
Note Generated docstrings for this pull request at #7615 |
Docstrings generation was requested by @anaisbetts. * biomejs#7599 (comment) The following files were modified: * `crates/biome_formatter/src/lib.rs` * `crates/biome_formatter_test/src/spec.rs`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
crates/biome_formatter/src/printer/mod.rs (1)
1526-1558
: Nice coverage for AUTO; mirrors CRLF/CR tests cleanly.The cfg‑gated assertions make this robust across OSes. Consider a tiny helper to avoid repeating the common “function main()” setup across the three line‑ending tests.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
crates/biome_cli/tests/snapshots/main_commands_check/check_help.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_ci/ci_help.snap
is excluded by!**/*.snap
and included by**
crates/biome_cli/tests/snapshots/main_commands_format/format_help.snap
is excluded by!**/*.snap
and included by**
crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/line_ending.js.snap
is excluded by!**/*.snap
and included by**
📒 Files selected for processing (8)
.changeset/warm-insects-dress.md
(1 hunks)crates/biome_configuration/src/formatter.rs
(1 hunks)crates/biome_configuration/src/overrides.rs
(1 hunks)crates/biome_formatter/src/lib.rs
(4 hunks)crates/biome_formatter/src/printer/mod.rs
(1 hunks)crates/biome_formatter_test/src/spec.rs
(1 hunks)crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/line_ending.js
(1 hunks)crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/options.json
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- crates/biome_configuration/src/overrides.rs
- crates/biome_configuration/src/formatter.rs
🧰 Additional context used
📓 Path-based instructions (5)
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**
📄 CodeRabbit inference engine (CLAUDE.md)
Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}
Files:
crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/options.json
crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/line_ending.js
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/options.json
crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/line_ending.js
crates/biome_formatter/src/printer/mod.rs
crates/biome_formatter_test/src/spec.rs
crates/biome_formatter/src/lib.rs
**/tests/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place test files under a tests/ directory in each crate
Files:
crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/options.json
crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/line_ending.js
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Format all Rust source files before committing (just f)
Files:
crates/biome_formatter/src/printer/mod.rs
crates/biome_formatter_test/src/spec.rs
crates/biome_formatter/src/lib.rs
.changeset/*.md
📄 CodeRabbit inference engine (CONTRIBUTING.md)
.changeset/*.md
: In changeset files, only use #### or ##### headers; avoid other header levels
Changeset descriptions should use past tense for what you did (e.g., "Added...")
Describe current Biome behavior in present tense within changesets (e.g., "Biome now supports...")
For bug fixes in changesets, start with a link to the issue (e.g., "Fixed #1234: ...")
When referencing rules or assists in changesets, include links to their documentation pages
Include a minimal code block in the changeset when applicable to demonstrate the change
End every sentence in the changeset description with a period
Files:
.changeset/warm-insects-dress.md
🧠 Learnings (9)
📚 Learning: 2025-08-11T11:48:27.774Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.774Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/specs/html/**/options.json : When non-default formatting options are needed for a test group, place an options.json (biome.json format) alongside the .html files in that folder
Applied to files:
crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/options.json
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
PR: biomejs/biome#7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.
Applied to files:
crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/options.json
📚 Learning: 2025-08-11T11:48:27.774Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.774Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/language.rs : Create tests/language.rs defining HtmlTestFormatLanguage and implement TestFormatLanguage for it
Applied to files:
crates/biome_formatter/src/printer/mod.rs
crates/biome_formatter_test/src/spec.rs
📚 Learning: 2025-08-11T11:48:27.774Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.774Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/spec_test.rs : Create tests/spec_test.rs implementing the run(spec_input_file, _expected_file, test_directory, _file_type) function as shown and include!("language.rs")
Applied to files:
crates/biome_formatter/src/printer/mod.rs
crates/biome_formatter_test/src/spec.rs
📚 Learning: 2025-08-11T11:48:27.774Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.774Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/spec_tests.rs : Create tests/spec_tests.rs in the biome_html_formatter crate that generates tests via tests_macros::gen_tests! for all HTML files at tests/specs/html/**/*.html
Applied to files:
crates/biome_formatter/src/printer/mod.rs
📚 Learning: 2025-08-11T11:53:15.299Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:53:15.299Z
Learning: Applies to crates/biome_service/../biome_lsp/src/server.tests.rs : Keep end-to-end LSP tests in biome_lsp’s server.tests.rs
Applied to files:
crates/biome_formatter/src/printer/mod.rs
📚 Learning: 2025-08-17T08:55:30.118Z
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-17T08:55:30.118Z
Learning: Applies to crates/biome_html_formatter/benches/html_formatter.rs : Maintain the HTML formatter benchmark at benches/html_formatter.rs within the biome_html_formatter crate
Applied to files:
crates/biome_formatter/src/printer/mod.rs
📚 Learning: 2025-09-13T16:16:06.459Z
Learnt from: ematipico
PR: biomejs/biome#7467
File: crates/biome_service/src/file_handlers/html.rs:456-466
Timestamp: 2025-09-13T16:16:06.459Z
Learning: In biome_formatter, consecutive LineMode::Hard elements are automatically collapsed to a single newline by the printer. The printer has a test "it_prints_consecutive_hard_lines_as_one" that demonstrates this behavior - multiple consecutive hard line breaks result in only one newline in the output, not extra blank lines.
Applied to files:
crates/biome_formatter/src/printer/mod.rs
📚 Learning: 2025-09-07T17:35:00.517Z
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-09-07T17:35:00.517Z
Learning: Applies to .changeset/*.md : Describe current Biome behavior in present tense within changesets (e.g., "Biome now supports...")
Applied to files:
.changeset/warm-insects-dress.md
🔇 Additional comments (8)
crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/line_ending.js (1)
1-17
: LGTM for the spec.Parsable, minimal, and fit for exercising line‑ending output with options.json.
crates/biome_formatter_test/src/spec.rs (1)
273-281
: Skip normalisation for AUTO: good call—preserves real OS newlines.This aligns with the feature’s intent. Please confirm your CI matrix (Windows + Linux/macOS) remains stable given the OS‑specific snapshots here.
.changeset/warm-insects-dress.md (1)
5-5
: Polish the header to match guideline tense and key.Use past tense and the fully‑qualified option path.
-#### lineEnding has a new option 'auto', that is CRLF on Windows, and LF on non-Windows +#### Added a new 'auto' option to formatter.lineEnding.The body text and examples look good. As per coding guidelines.
crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/options.json (1)
2-2
: Please verify the $schema relative depth.From crates/biome_js_formatter/tests/specs/js/module/line-ending/auto/, reaching the repo root should require fewer “../” hops than shown; this path looks over‑elevated. Editors may fail to resolve the schema. Keep the key as is ("lineEnding": "auto")—that’s spot on.
Run to confirm the $schema resolves to an existing file:
crates/biome_formatter/src/lib.rs (4)
151-154
: LGTM! Clean enum variant addition.The new
Auto
variant is well-documented and aligns perfectly with the PR objectives for cross-platform line ending handling.
158-174
: Platform-specific logic implemented correctly.The conditional compilation for Windows/non-Windows is spot on, though the method signature necessarily changes from
const fn
tofn
due to the runtime platform detection.
191-194
: Consistent method implementation.The
is_auto
method follows the established pattern of otheris_*
methods perfectly. Nice consistency!
205-206
: Complete trait implementation coverage.Both
FromStr
andDisplay
implementations properly handle the newAuto
variant. The string representations are consistent with the established patterns.Also applies to: 218-219
The line ending option is also available for each language, for example here the option for JavaScript: https://github.com/biomejs/biome/blob/main/crates%2Fbiome_configuration%2Fsrc%2Fjavascript%2Fformatter.rs#L78-L84 We should update the docstrings for each language: JavaScript, JSON, CSS, html and graphql |
@ematipico I'll try to get to this today! |
61805d7
to
34532cd
Compare
Docstrings generation was requested by @anaisbetts. * biomejs#7599 (comment) The following files were modified: * `crates/biome_formatter/src/lib.rs` * `crates/biome_formatter_test/src/spec.rs`
34532cd
to
ae98b6b
Compare
- Add 'auto' option to LineEnding enum that uses CRLF on Windows and LF on other platforms - Update configuration schema to include auto line ending option - Update CLI argument parsing to accept 'auto' value - Update TypeScript workspace configuration - Add helper method is_auto() to LineEnding enum
- Add test file with LF line endings - Add test configuration using auto line ending option - Add snapshot test for auto line ending behavior
Docstrings generation was requested by @anaisbetts. * biomejs#7599 (comment) The following files were modified: * `crates/biome_formatter/src/lib.rs` * `crates/biome_formatter_test/src/spec.rs`
ae98b6b
to
16a5245
Compare
@ematipico I fixed the snapshot failures but it looks like main is 🔴 on CI at the moment? I think I accidentally picked up that failure on the rebase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @anaisbetts ! Great feature 🙌 I left a couple of nits that I will apply
Summary
Related to #7598, this implements suggestion 3, "auto" as a lineEnding format, without making it the default. Without this feature, it is very difficult to run Biome against cross-platform environments such as Electron apps, because
biome check
in CI will inevitably fail either macOS or Windows, there is no correct option other than completely disabling the formatter in CI, or using.gitattributes
to force the repo to be checked out in LFTest Plan
Unit tests