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:
Micha Reiser 2023-06-26 14:15:55 +02:00 committed by GitHub
parent dd0d1afb66
commit f18a1f70de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 268 additions and 79 deletions

View file

@ -0,0 +1,8 @@
[
{
"magic_trailing_comma": "respect"
},
{
"magic_trailing_comma": "ignore"
}
]

View 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",
)