summaryrefslogtreecommitdiff
path: root/pylint/reporters/collecting_reporter.py
blob: 68c0cbf9e8fced6c2316e0c2f559bda2fe795104 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/master/LICENSE

from pylint.reporters.base_reporter import BaseReporter


class CollectingReporter(BaseReporter):
    """collects messages"""

    name = "collector"

    def __init__(self):
        BaseReporter.__init__(self)
        self.messages = []

    def handle_message(self, msg):
        self.messages.append(msg)

    def reset(self):
        self.messages = []

    _display = None