mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 05:45:24 +00:00
Change line-ending
default to auto
(#8057)
This commit is contained in:
parent
a00c445580
commit
962472da96
4 changed files with 49 additions and 20 deletions
|
@ -2623,16 +2623,16 @@ pub struct FormatOptions {
|
|||
|
||||
/// The character Ruff uses at the end of a line.
|
||||
///
|
||||
/// * `auto`: The newline style is detected automatically on a file per file basis. Files with mixed line endings will be converted to the first detected line ending. Defaults to `\n` for files that contain no line endings.
|
||||
/// * `lf`: Line endings will be converted to `\n`. The default line ending on Unix.
|
||||
/// * `cr-lf`: Line endings will be converted to `\r\n`. The default line ending on Windows.
|
||||
/// * `auto`: The newline style is detected automatically on a file per file basis. Files with mixed line endings will be converted to the first detected line ending. Defaults to `\n` for files that contain no line endings.
|
||||
/// * `native`: Line endings will be converted to `\n` on Unix and `\r\n` on Windows.
|
||||
#[option(
|
||||
default = r#"lf"#,
|
||||
value_type = r#""lf" | "cr-lf" | "auto" | "native""#,
|
||||
default = r#"auto"#,
|
||||
value_type = r#""auto" | "lf" | "cr-lf" | "native""#,
|
||||
example = r#"
|
||||
# Automatically detect the line ending on a file per file basis.
|
||||
line-ending = "auto"
|
||||
# Use `\n` line endings for all files
|
||||
line-ending = "lf"
|
||||
"#
|
||||
)]
|
||||
pub line_ending: Option<LineEnding>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue