Deprecate MapReduceMixin and implements its methods in BaseChecker#6383
Deprecate MapReduceMixin and implements its methods in BaseChecker#6383DanielNoord merged 7 commits intopylint-dev:mainfrom
MapReduceMixin and implements its methods in BaseChecker#6383Conversation
Pull Request Test Coverage Report for Build 2190395707
💛 - Coveralls |
Pierre-Sassoulas
left a comment
There was a problem hiding this comment.
Won't this imply that BaseChecker is able to perform map reduce when it's not ?
Yes and no I guess. It is able to perform it in so far as that it has a The issue with the current implementation is that there is a dictionary mapping checker to data. Only checkers that implement |
Pierre-Sassoulas
left a comment
There was a problem hiding this comment.
LGTM the final result is pretty nice and reasonable 👍
Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
|
Thanks for the thorough review guys! Agree with @Pierre-Sassoulas! |
|
(Maybe a better PR title, though... now that BaseChecker isn't a MapReduceMixin.) |
BaseChecker a MapReduceMixinMapReduceMixin and implements its methods in BaseChecker
…ker`` (pylint-dev#6383) Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com> Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
|
I completely missed this change, but it's great to see. When I added the Mixin object the intent was to have as little impact over the core code as possible, it's always been clear that the right intemediary place for it was in the base-checker - longer term the map-reduce functionality should completely go in favour of a fully parallelised astroid or moved into astroid
Mypy is definitely correct that there's an issue, but it's not a warning about a design flaw. Mypy is just showing that there's a lack of type checking and/or explicit error handling around whether the mix-in has been applied or not. After all python isn't C++ and is a dynamic language which allows for that sort of thing more easily :) IIRC the design implicitly ensures that the mix-in is applied. |
and preferred name in
script/.contributors_aliases.jsonType of Changes
Description
Kinda high priority since
mainis broken due to twotypingPRs apparently depending on each other but passing on their own.maincomplains aboutchecker.get_map_data()andchecker.reduce_map_datainparallel.py. Instead of adding ignores there I thinkmypyis actually right and warns of a design flaw. There is no need to separate theseMixIns(ideally we would deprecate theMixInas there is little overhead of makingBaseCheckeraMapReduceMixinand just having the methods do nothing.That's why I propose this solution.