diff options
| author | clavedeluna <danalitovsky+git@gmail.com> | 2022-11-29 08:32:33 -0300 |
|---|---|---|
| committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2022-11-29 16:30:44 +0100 |
| commit | f331bb1b01f3fc4566296ec967796576151ea869 (patch) | |
| tree | 1897e4abe0252899d862171815984e5102286497 /doc/data | |
| parent | e51413859d8ff82ead6868d3b3e150b9e79ae57c (diff) | |
| download | pylint-git-f331bb1b01f3fc4566296ec967796576151ea869.tar.gz | |
add docs for too many nested blocks
Diffstat (limited to 'doc/data')
| -rw-r--r-- | doc/data/messages/t/too-many-nested-blocks/bad.py | 10 | ||||
| -rw-r--r-- | doc/data/messages/t/too-many-nested-blocks/details.rst | 1 | ||||
| -rw-r--r-- | doc/data/messages/t/too-many-nested-blocks/good.py | 7 |
3 files changed, 16 insertions, 2 deletions
diff --git a/doc/data/messages/t/too-many-nested-blocks/bad.py b/doc/data/messages/t/too-many-nested-blocks/bad.py new file mode 100644 index 000000000..8a2c79ee1 --- /dev/null +++ b/doc/data/messages/t/too-many-nested-blocks/bad.py @@ -0,0 +1,10 @@ +def correct_fruits(fruits): + if len(fruits) > 1: # [too-many-nested-blocks] + if "apple" in fruits: + if "orange" in fruits: + count = fruits["orange"] + if count % 2: + if "kiwi" in fruits: + if count == 2: + return True + return False diff --git a/doc/data/messages/t/too-many-nested-blocks/details.rst b/doc/data/messages/t/too-many-nested-blocks/details.rst deleted file mode 100644 index ab8204529..000000000 --- a/doc/data/messages/t/too-many-nested-blocks/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-nested-blocks/good.py b/doc/data/messages/t/too-many-nested-blocks/good.py index c40beb573..1b14770ae 100644 --- a/doc/data/messages/t/too-many-nested-blocks/good.py +++ b/doc/data/messages/t/too-many-nested-blocks/good.py @@ -1 +1,6 @@ -# This is a placeholder for correct code for this message. +def correct_fruits(fruits): + if len(fruits) > 1 and "apple" in fruits and "orange" in fruits: + count = fruits["orange"] + if count % 2 and "kiwi" in fruits and count == 2: + return True + return False |
