collecting_reporter.py 735 B

12345678910111213141516171819202122232425262728
  1. # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  2. # For details: https://github.com/pylint-dev/pylint/blob/main/LICENSE
  3. # Copyright (c) https://github.com/pylint-dev/pylint/blob/main/CONTRIBUTORS.txt
  4. from __future__ import annotations
  5. from typing import TYPE_CHECKING
  6. from pylint.reporters.base_reporter import BaseReporter
  7. if TYPE_CHECKING:
  8. from pylint.reporters.ureports.nodes import Section
  9. class CollectingReporter(BaseReporter):
  10. """Collects messages."""
  11. name = "collector"
  12. def __init__(self) -> None:
  13. super().__init__()
  14. self.messages = []
  15. def reset(self) -> None:
  16. self.messages = []
  17. def _display(self, layout: Section) -> None:
  18. pass