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
Make min-similarity-lines == 0
stop similarity check
#4970
Make min-similarity-lines == 0
stop similarity check
#4970
Conversation
This makes it so that setting ``min-similarity-lines`` to zero exit the similarity code checker with a successful exit. This closes pylint-dev#4901
Pull Request Test Coverage Report for Build 1205498418
💛 - Coveralls |
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.
The fix won't solve the the issue if the similarity checker is executed via pylint
. Only when called directly.
A better solution would probably be to insert an early return here:
https://github.com/PyCQA/pylint/blob/005b7d22c75c7c32c1dafd7b548d858c0682e58a/pylint/checkers/similar.py#L391-L393
Would it be possible to add a test for this? Or does the unittest inherently call the module directly? |
@DanielNoord Have you tried moving it to the location I suggested? The test case you wrote should already work. |
Oh no, I'm sorry! I assumed the fact that this test succeeded without actually succeeding in its intent meant that another test would be necessary. This does indeed pass. Based on your comment I don't think another test is necessary? Or am I mistaken? |
No. The test does already cover it. |
Changed! Sorry for taking up so much of your time these past days, I will try and be more thorough in future PR's! |
Don't worry too much about it. I understand that it feels good to open a lot of different PRs. Just from a reviewer perspective it's sometimes better to take it a bit slower. |
doc/whatsnew/<current release.rst>
.Type of Changes
Description
This makes it so that setting
min-similarity-lines
to zero exits thesimilarity code checker with a successful exit.
This closes #4901