From c50834ff6a47ed567756814a77aa370cf9b090a9 Mon Sep 17 00:00:00 2001 From: Andreas Finkler <3929834+DudeNr33@users.noreply.github.com> Date: Sun, 3 Apr 2022 16:25:26 +0200 Subject: [PATCH] Add examples for ``bad-string-format-type`` (#6164) Co-authored-by: Vladyslav Krylasov --- doc/data/messages/b/bad-string-format-type/bad.py | 1 + doc/data/messages/b/bad-string-format-type/details.rst | 2 ++ doc/data/messages/b/bad-string-format-type/good.py | 1 + doc/data/messages/b/bad-string-format-type/related.rst | 2 ++ 4 files changed, 6 insertions(+) create mode 100644 doc/data/messages/b/bad-string-format-type/bad.py create mode 100644 doc/data/messages/b/bad-string-format-type/details.rst create mode 100644 doc/data/messages/b/bad-string-format-type/good.py create mode 100644 doc/data/messages/b/bad-string-format-type/related.rst diff --git a/doc/data/messages/b/bad-string-format-type/bad.py b/doc/data/messages/b/bad-string-format-type/bad.py new file mode 100644 index 0000000000..a58a5ba7b5 --- /dev/null +++ b/doc/data/messages/b/bad-string-format-type/bad.py @@ -0,0 +1 @@ +print("%d" % "1") # [bad-string-format-type] diff --git a/doc/data/messages/b/bad-string-format-type/details.rst b/doc/data/messages/b/bad-string-format-type/details.rst new file mode 100644 index 0000000000..65752275c3 --- /dev/null +++ b/doc/data/messages/b/bad-string-format-type/details.rst @@ -0,0 +1,2 @@ +This check is currently only active for "old-style" string formatting as seen in the examples. +See `Issue #6085 `_ for more information. diff --git a/doc/data/messages/b/bad-string-format-type/good.py b/doc/data/messages/b/bad-string-format-type/good.py new file mode 100644 index 0000000000..00ee8aff79 --- /dev/null +++ b/doc/data/messages/b/bad-string-format-type/good.py @@ -0,0 +1 @@ +print("%d" % 1) diff --git a/doc/data/messages/b/bad-string-format-type/related.rst b/doc/data/messages/b/bad-string-format-type/related.rst new file mode 100644 index 0000000000..b6aadf541e --- /dev/null +++ b/doc/data/messages/b/bad-string-format-type/related.rst @@ -0,0 +1,2 @@ +- `Format String Syntax `_ +- `PyFormat `_