summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/data/messages/t/too-many-return-statements/bad.py16
-rw-r--r--doc/data/messages/t/too-many-return-statements/details.rst1
-rw-r--r--doc/data/messages/t/too-many-return-statements/good.py14
3 files changed, 29 insertions, 2 deletions
diff --git a/doc/data/messages/t/too-many-return-statements/bad.py b/doc/data/messages/t/too-many-return-statements/bad.py
new file mode 100644
index 000000000..e421d29a7
--- /dev/null
+++ b/doc/data/messages/t/too-many-return-statements/bad.py
@@ -0,0 +1,16 @@
+def to_string(x): # [too-many-return-statements]
+ # max of 6 by default, can be configured
+ if x == 1:
+ return 'This is one.'
+ if x == 2:
+ return 'This is two.'
+ if x == 3:
+ return 'This is three.'
+ if x == 4:
+ return 'This is four.'
+ if x == 5:
+ return 'This is five.'
+ if x == 6:
+ return 'This is six.'
+ if x == 7:
+ return 'This is seven.'
diff --git a/doc/data/messages/t/too-many-return-statements/details.rst b/doc/data/messages/t/too-many-return-statements/details.rst
deleted file mode 100644
index ab8204529..000000000
--- a/doc/data/messages/t/too-many-return-statements/details.rst
+++ /dev/null
@@ -1 +0,0 @@
-You can help us make the doc better `by contributing <https://github.com/PyCQA/pylint/issues/5953>`_ !
diff --git a/doc/data/messages/t/too-many-return-statements/good.py b/doc/data/messages/t/too-many-return-statements/good.py
index c40beb573..0c4032f53 100644
--- a/doc/data/messages/t/too-many-return-statements/good.py
+++ b/doc/data/messages/t/too-many-return-statements/good.py
@@ -1 +1,13 @@
-# This is a placeholder for correct code for this message.
+NUMBERS_TO_STRINGS = {
+ 1: 'one',
+ 2: 'two',
+ 3: 'three',
+ 4: 'four',
+ 5: 'five',
+ 6: 'six',
+ 7: 'seven'
+}
+
+
+def to_string(x):
+ return f'This is {NUMBERS_TO_STRINGS.get(x)}.'