summaryrefslogtreecommitdiff
path: root/doc/data/messages/n/nested-min-max/good.py
diff options
context:
space:
mode:
authorOsher De Paz <odepaz@redhat.com>2022-11-21 10:12:22 +0200
committerGitHub <noreply@github.com>2022-11-21 09:12:22 +0100
commitbb5781cd94eace021edf82954d151810770d241b (patch)
tree78bcbfc8196bbf5f6d58bd5ca9a6c22b89f587d8 /doc/data/messages/n/nested-min-max/good.py
parentf2e8ba3690431957c74ccb5e2dd6e1c4512fa0bc (diff)
downloadpylint-git-bb5781cd94eace021edf82954d151810770d241b.tar.gz
Add extension checker for nested min/max (#7550)
This adds a new checker (not active by default) which identifies usages similar to ``min(<arg1>, min(<arg2>, <arg3>))`` and suggests using a simplified form of ``min(<arg1>, <arg2>, <arg3>)``. Same goes for ``max`` usage. The logic is as follows: it detects calls to either ``min`` or ``max`` functions, and whenever one of their arguments is that same function, it emits the message. Co-authored-by: Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>
Diffstat (limited to 'doc/data/messages/n/nested-min-max/good.py')
-rw-r--r--doc/data/messages/n/nested-min-max/good.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/doc/data/messages/n/nested-min-max/good.py b/doc/data/messages/n/nested-min-max/good.py
new file mode 100644
index 000000000..2d348b224
--- /dev/null
+++ b/doc/data/messages/n/nested-min-max/good.py
@@ -0,0 +1 @@
+print(min(1, 2, 3))