Skip to content
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

[base checker] Fix the ordering of checkers for extensions #8956

Merged

Conversation

Pierre-Sassoulas
Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas commented Aug 15, 2023

Type of Changes

Type
βœ“ πŸ› Bug fix

Description

The comparison was not done properly for extension when the second values given was a builtin and the first one an extension. The tests were not testing this case properly because the alphabetical order made us think that everything went right. Added a test with a low alphabetical value extension checker.

Necessary for #8951

@Pierre-Sassoulas Pierre-Sassoulas added Maintenance Discussion or action around maintaining pylint or the dev workflow Skip news πŸ”‡ This change does not require a changelog entry labels Aug 15, 2023
The comparison was not done properly for extension when the second values
given was a builtin and the first one an extension. The tests were not
testing this case properly because the alphabetical order made us think
that everything went right. Added a test with a low value extension checker.

Necessary for pylint-dev#8951
@codecov
Copy link

codecov bot commented Aug 15, 2023

Codecov Report

Merging #8956 (3e1f487) into main (ea15e5e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #8956   +/-   ##
=======================================
  Coverage   95.74%   95.74%           
=======================================
  Files         173      173           
  Lines       18557    18558    +1     
=======================================
+ Hits        17767    17768    +1     
  Misses        790      790           
Files Changed Coverage Ξ”
pylint/checkers/base_checker.py 95.00% <100.00%> (+0.04%) ⬆️

if not isinstance(other, BaseChecker):
# print(f"{other} is not a base checker.")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite a bit of debug statement?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could turn that into comments, but then we'd need to transform it in debug statement again if there's a problem in the future πŸ˜„

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I think we could remove them here. This feels a bit weird to me

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah true, comments explaining what the code is doing are bad form. (xor operator that makes it necessary must be bad form too πŸ˜… )

@Pierre-Sassoulas Pierre-Sassoulas merged commit 12d24c0 into pylint-dev:main Aug 15, 2023
44 checks passed
@Pierre-Sassoulas Pierre-Sassoulas deleted the fix-checkers-sorting branch August 15, 2023 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Discussion or action around maintaining pylint or the dev workflow Skip news πŸ”‡ This change does not require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants