Support duplicate-code message with --jobs#8757
Support duplicate-code message with --jobs#8757jacobtylerwalls merged 1 commit intopylint-dev:mainfrom
duplicate-code message with --jobs#8757Conversation
duplicate-code message with --jobsduplicate-code message with --jobs
| join(HERE, "functional", "a", "arguments.py"), | ||
| ], | ||
| out=out, | ||
| # We expect similarities to fail and an error |
There was a problem hiding this comment.
No reason to expect similarity to fail when checking only one file. Maybe an earlier version of this test checked the same file twice?
There was a problem hiding this comment.
The comment was very unclear, sorry about that.
It was meant to say something like:
if we test the same file twice, which this test was doing, in parallel mode we get extra errors, so we only test a single file here in parallel mode, ensuring it errors. All parallel checks are in their own file now.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #8757 +/- ##
=======================================
Coverage 95.82% 95.82%
=======================================
Files 173 173
Lines 18386 18386
=======================================
+ Hits 17618 17619 +1
+ Misses 768 767 -1
|
| """Use the given linter to lint the files with given amount of workers (jobs). | ||
|
|
||
| This splits the work filestream-by-filestream. If you need to do work across | ||
| multiple files, as in the similarity-checker, then implement the map/reduce mixin functionality. |
There was a problem hiding this comment.
is it no longer [considered] a mix-in class?
There was a problem hiding this comment.
Oooooh, hadn't seen those, sexy
| Calls self.close() to actually calculate and report duplicate code. | ||
| """ | ||
| Similar.combine_mapreduce_data(self, linesets_collection=data) | ||
| self.close() |
There was a problem hiding this comment.
Simple as that is it! Great stuff!! :)
There was a problem hiding this comment.
Holy mother of Guido, was it that simple ?!
|
I just want to see the primer result with |
dc5f010 to
0a88e97
Compare
DanielNoord
left a comment
There was a problem hiding this comment.
Haven't looked at the code but great find Jacob!
Pierre-Sassoulas
left a comment
There was a problem hiding this comment.
This is such an elegant fix to a problem that have been plaguing pylint for a decade, amazing ! Thanks also to @doublethefish who did almost all the work minus that one self.close() in 2021😄
|
IIRC I tried adding |
Type of Changes
Description
All the groundwork for detecting
duplicate-codewith--jobswas laid in #4007, but it was only unit tested without actually checking that messages were emitted.Closes #374 (I moved the remaining cyclic-import issue to #4171)