Skip to content

Commit

Permalink
[doc] Add an example for 'missing-format-string-key' (#8379)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Sassoulas authored Mar 3, 2023
1 parent 6846a13 commit 81bb644
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
7 changes: 7 additions & 0 deletions doc/data/messages/m/missing-format-string-key/bad.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# +1: [missing-format-string-key]
fruit_prices = """
Apple: %(apple_price)d ¤
Orange: %(orange_price)d ¤
""" % {
"apple_price": 42
}
1 change: 0 additions & 1 deletion doc/data/messages/m/missing-format-string-key/details.rst

This file was deleted.

8 changes: 7 additions & 1 deletion doc/data/messages/m/missing-format-string-key/good.py
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
# This is a placeholder for correct code for this message.
fruit_prices = """
Apple: %(apple_price)d ¤
Orange: %(orange_price)d ¤
""" % {
"apple_price": 42,
"orange_price": 87,
}

0 comments on commit 81bb644

Please sign in to comment.