Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding test case for skip-magic-trailing-comma
Functionality added in pull request #48
- Loading branch information
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"""Example of black and magic commas.""" | ||
|
||
vegetables = { | ||
"carrot", | ||
"parsnip", | ||
"potato", | ||
"swede", | ||
"leak", | ||
"aubergine", | ||
"tomato", | ||
"peas", | ||
"beans", | ||
} | ||
|
||
# This set would easily fit on one line, but a trailing comma | ||
# after the final entry tells black (by default) to leave this | ||
# with one entry per line: | ||
yucky = { | ||
"aubergine", | ||
"squid", | ||
"snails", | ||
} | ||
|
||
print("I dislike these vegetables: %s." % ", ".join(vegetables.intersection(yucky))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
[tool.black] | ||
skip-string-normalization = true | ||
skip-magic-trailing-comma = true |