-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation for duplicate-string-formatting-argument and bidire…
…ctional-unicode (#8269) Co-authored-by: Pierre Sassoulas <[email protected]>
- Loading branch information
1 parent
d1b55f4
commit fadd9dc
Showing
6 changed files
with
43 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# +1: [bidirectional-unicode] | ||
example = "x" * 100 # "x" is assigned |
This file was deleted.
Oops, something went wrong.
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 +1 @@ | ||
# This is a placeholder for correct code for this message. | ||
example = "x[U+2194]" * 100 |
26 changes: 26 additions & 0 deletions
26
doc/data/messages/d/duplicate-string-formatting-argument/bad.py
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,26 @@ | ||
# pylint: disable=missing-docstring, consider-using-f-string | ||
|
||
SEE = "see 👀" | ||
SEA = "sea 🌊" | ||
|
||
# +1: [duplicate-string-formatting-argument,duplicate-string-formatting-argument] | ||
CONST = """ | ||
A sailor went to {}, {}, {} | ||
To {} what he could {}, {}, {} | ||
But all that he could {}, {}, {} | ||
Was the bottom of the deep blue {}, {}, {}! | ||
""".format( | ||
SEA, | ||
SEA, | ||
SEA, | ||
SEE, | ||
SEE, | ||
SEE, | ||
SEE, | ||
SEE, | ||
SEE, | ||
SEE, | ||
SEA, | ||
SEA, | ||
SEA, | ||
) |
1 change: 0 additions & 1 deletion
1
doc/data/messages/d/duplicate-string-formatting-argument/details.rst
This file was deleted.
Oops, something went wrong.
15 changes: 14 additions & 1 deletion
15
doc/data/messages/d/duplicate-string-formatting-argument/good.py
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 +1,14 @@ | ||
# This is a placeholder for correct code for this message. | ||
# pylint: disable=missing-docstring, consider-using-f-string | ||
|
||
SEE = "see 👀" | ||
SEA = "sea 🌊" | ||
|
||
# +1: [duplicate-string-formatting-argument,duplicate-string-formatting-argument] | ||
CONST = """ | ||
A sailor went to {sea}, {sea}, {sea} | ||
To {see} what he could {see}, {see}, {see} | ||
But all that he could {see}, {see}, {see} | ||
Was the bottom of the deep blue {sea}, {sea}, {sea}! | ||
""".format( | ||
sea=SEA, see=SEE | ||
) |