summaryrefslogtreecommitdiff
path: root/pylint/checkers/mapreduce_checker.py
blob: 3078b6872e8e0f5f828e85d4708ff09a21f02fe2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
# Copyright (c) https://github.com/PyCQA/pylint/graphs/contributors
import abc


class MapReduceMixin(metaclass=abc.ABCMeta):
    """A mixin design to allow multiprocess/threaded runs of a Checker."""

    @abc.abstractmethod
    def get_map_data(self):
        """Returns mergeable/reducible data that will be examined."""

    @abc.abstractmethod
    def reduce_map_data(self, linter, data):
        """For a given Checker, receives data for all mapped runs."""