-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix nested-min-max
output msg
#8234
Conversation
e24659c
to
9393480
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #8234 +/- ##
=======================================
Coverage 95.45% 95.45%
=======================================
Files 177 177
Lines 18646 18654 +8
=======================================
+ Hits 17798 17806 +8
Misses 848 848
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks amazing already !
tests/test_self.py
Outdated
@@ -1302,6 +1302,21 @@ def test_no_name_in_module(self) -> None: | |||
[module, "-E"], expected_output="", unexpected_output=unexpected | |||
) | |||
|
|||
def test_nested_min_max_splats(self) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove this if we also have functional tests(I like functional tests a lot)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'd think, but functional tests aren't testing the output message language exactly, so I felt better adding this to ensure "*" is in the message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly there is an issue with *
in functional tests ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No no, no issue. You can see the functional test .txt file looks great.
What I mean is that as far as I understand, the functional test will ensure that the message
nested-min-max appears in a specific line, indicated by adding # [nested-min-max]
to that line
but what I want to test is not just that the msg is emitted, but that the msg suggestion specifically says "it's possible to do 'max(3, *nums, *lst2)' i". I can only assert this in the unit test, not the functional test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/PyCQA/pylint/pull/8234/files#r1100266806 (Modify the expected output in this file and the tests should fail provided you have python 3.8 ore more recent)
pylint/checkers/utils.py
Outdated
@@ -238,6 +238,13 @@ | |||
{"_sitebuiltins.Quitter", "sys.exit", "posix._exit", "nt._exit"} | |||
) | |||
|
|||
DICT_TYPES = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep this in the variable checkers, we don't want to have checkers be coupled because of this constant and the module name 'utils' is horrible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair point! the repo uses "utils" a ton. So just have both "DICT_TYPES" in each module regardless of duplication?
This comment has been minimized.
This comment has been minimized.
π€ According to the primer, this change has no effect on the checked open source code. π€π This comment was generated for commit a30dd4b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π
(cherry picked from commit 29684fe)
(cherry picked from commit 29684fe) Co-authored-by: Dani Alcala <[email protected]>
Type of Changes
Description
Fix
nested-min-max
suggestion message to indicate it's possible to splat iterable objects.Closes #8168