Skip to content

Commit

Permalink
ruff_python_formatter: add 'line-ending' to test output
Browse files Browse the repository at this point in the history
It looks like no previous snapshot tests have configured the line ending
to anything other than the default, so this wasn't included in the test
output. But we would actually like to try and test that line endings are
correctly preserved when reformatting code snippets, so we make the
option visible in the snapshot.
  • Loading branch information
BurntSushi committed Nov 22, 2023
1 parent 570f2af commit 06c3c22
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/ruff_python_formatter/tests/fixtures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,13 +342,15 @@ impl fmt::Display for DisplayPyOptions<'_> {
line-width = {line_width}
indent-width = {indent_width}
quote-style = {quote_style:?}
line-ending = {line_ending:?}
magic-trailing-comma = {magic_trailing_comma:?}
docstring-code = {docstring_code:?}
preview = {preview:?}"#,
indent_style = self.0.indent_style(),
indent_width = self.0.indent_width().value(),
line_width = self.0.line_width().value(),
quote_style = self.0.quote_style(),
line_ending = self.0.line_ending(),
magic_trailing_comma = self.0.magic_trailing_comma(),
docstring_code = self.0.docstring_code(),
preview = self.0.preview()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ indent-style = space
line-width = 88
indent-width = 4
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand Down Expand Up @@ -332,6 +333,7 @@ indent-style = space
line-width = 88
indent-width = 2
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand Down Expand Up @@ -499,6 +501,7 @@ indent-style = tab
line-width = 88
indent-width = 8
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand Down Expand Up @@ -666,6 +669,7 @@ indent-style = tab
line-width = 88
indent-width = 4
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ indent-style = space
line-width = 88
indent-width = 4
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand Down Expand Up @@ -663,6 +664,7 @@ indent-style = space
line-width = 88
indent-width = 2
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand Down Expand Up @@ -997,6 +999,7 @@ indent-style = tab
line-width = 88
indent-width = 8
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand Down Expand Up @@ -1331,6 +1334,7 @@ indent-style = tab
line-width = 88
indent-width = 4
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand Down Expand Up @@ -1665,6 +1669,7 @@ indent-style = space
line-width = 88
indent-width = 4
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Enabled
preview = Disabled
Expand Down Expand Up @@ -1999,6 +2004,7 @@ indent-style = space
line-width = 88
indent-width = 2
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Enabled
preview = Disabled
Expand Down Expand Up @@ -2333,6 +2339,7 @@ indent-style = tab
line-width = 88
indent-width = 8
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Enabled
preview = Disabled
Expand Down Expand Up @@ -2667,6 +2674,7 @@ indent-style = tab
line-width = 88
indent-width = 4
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Enabled
preview = Disabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ indent-style = space
line-width = 88
indent-width = 4
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand Down Expand Up @@ -283,6 +284,7 @@ indent-style = space
line-width = 88
indent-width = 4
quote-style = Single
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ indent-style = space
line-width = 88
indent-width = 4
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand Down Expand Up @@ -322,6 +323,7 @@ indent-style = space
line-width = 88
indent-width = 4
quote-style = Single
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ indent-style = space
line-width = 88
indent-width = 4
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand Down Expand Up @@ -66,6 +67,7 @@ indent-style = space
line-width = 88
indent-width = 2
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ indent-style = space
line-width = 88
indent-width = 4
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand All @@ -28,6 +29,7 @@ indent-style = space
line-width = 88
indent-width = 1
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand All @@ -43,6 +45,7 @@ indent-style = tab
line-width = 88
indent-width = 4
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ indent-style = space
line-width = 88
indent-width = 4
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand Down Expand Up @@ -59,6 +60,7 @@ indent-style = space
line-width = 88
indent-width = 2
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand Down Expand Up @@ -90,6 +92,7 @@ indent-style = tab
line-width = 88
indent-width = 4
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ indent-style = space
line-width = 88
indent-width = 4
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand Down Expand Up @@ -159,6 +160,7 @@ indent-style = space
line-width = 88
indent-width = 4
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Enabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ indent-style = space
line-width = 88
indent-width = 4
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand Down Expand Up @@ -100,6 +101,7 @@ indent-style = space
line-width = 88
indent-width = 4
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Ignore
docstring-code = Disabled
preview = Disabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ indent-style = space
line-width = 88
indent-width = 2
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand All @@ -44,6 +45,7 @@ indent-style = space
line-width = 88
indent-width = 4
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand All @@ -70,6 +72,7 @@ indent-style = space
line-width = 88
indent-width = 8
quote-style = Double
line-ending = LineFeed
magic-trailing-comma = Respect
docstring-code = Disabled
preview = Disabled
Expand Down

0 comments on commit 06c3c22

Please sign in to comment.