mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-24 13:33:50 +00:00
Add tests for skip magic trailing comma
<!-- Thank you for contributing to Ruff! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary This PR adds tests that verify that the magic trailing comma is not respected if disabled in the formatter options. Our test setup now allows to create a `<fixture-name>.options.json` file that contains an array of configurations that should be tested. <!-- What's the purpose of the change? What does it do, and why? --> ## Test Plan It's all about tests :) <!-- How was it tested? -->
This commit is contained in:
parent
dd0d1afb66
commit
f18a1f70de
27 changed files with 268 additions and 79 deletions
|
@ -0,0 +1,8 @@
|
|||
[
|
||||
{
|
||||
"magic_trailing_comma": "respect"
|
||||
},
|
||||
{
|
||||
"magic_trailing_comma": "ignore"
|
||||
}
|
||||
]
|
22
crates/ruff_python_formatter/resources/test/fixtures/ruff/skip_magic_trailing_comma.py
vendored
Normal file
22
crates/ruff_python_formatter/resources/test/fixtures/ruff/skip_magic_trailing_comma.py
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
(
|
||||
"First entry",
|
||||
"Second entry",
|
||||
"last with trailing comma",
|
||||
)
|
||||
|
||||
(
|
||||
"First entry",
|
||||
"Second entry",
|
||||
"last without trailing comma"
|
||||
)
|
||||
|
||||
(
|
||||
"First entry",
|
||||
"Second entry",
|
||||
"third entry",
|
||||
"fourth entry",
|
||||
"fifth entry",
|
||||
"sixt entry",
|
||||
"seventh entry",
|
||||
"eigth entry",
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue