From 81bb644a82fcbc7c3d53d7a4faa297c57925f1c7 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Fri, 3 Mar 2023 19:48:39 +0100 Subject: [PATCH] [doc] Add an example for 'missing-format-string-key' (#8379) --- doc/data/messages/m/missing-format-string-key/bad.py | 7 +++++++ doc/data/messages/m/missing-format-string-key/details.rst | 1 - doc/data/messages/m/missing-format-string-key/good.py | 8 +++++++- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 doc/data/messages/m/missing-format-string-key/bad.py delete mode 100644 doc/data/messages/m/missing-format-string-key/details.rst diff --git a/doc/data/messages/m/missing-format-string-key/bad.py b/doc/data/messages/m/missing-format-string-key/bad.py new file mode 100644 index 0000000000..4bbfcacbc9 --- /dev/null +++ b/doc/data/messages/m/missing-format-string-key/bad.py @@ -0,0 +1,7 @@ +# +1: [missing-format-string-key] +fruit_prices = """ +Apple: %(apple_price)d ¤ +Orange: %(orange_price)d ¤ +""" % { + "apple_price": 42 +} diff --git a/doc/data/messages/m/missing-format-string-key/details.rst b/doc/data/messages/m/missing-format-string-key/details.rst deleted file mode 100644 index ab82045295..0000000000 --- a/doc/data/messages/m/missing-format-string-key/details.rst +++ /dev/null @@ -1 +0,0 @@ -You can help us make the doc better `by contributing `_ ! diff --git a/doc/data/messages/m/missing-format-string-key/good.py b/doc/data/messages/m/missing-format-string-key/good.py index c40beb573f..11b8567620 100644 --- a/doc/data/messages/m/missing-format-string-key/good.py +++ b/doc/data/messages/m/missing-format-string-key/good.py @@ -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, +}