global_test_linter.py 599 B

1234567891011121314151617181920
  1. # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  2. # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
  3. from pylint import checkers
  4. from pylint.lint import PyLinter
  5. from pylint.testutils.reporter_for_tests import GenericTestReporter
  6. def create_test_linter():
  7. test_reporter = GenericTestReporter()
  8. linter_ = PyLinter()
  9. linter_.set_reporter(test_reporter)
  10. linter_.config.persistent = 0
  11. checkers.initialize(linter_)
  12. return linter_
  13. # Can't be renamed to a constant (easily), it breaks countless tests
  14. linter = create_test_linter()