File tree 2 files changed +21
-11
lines changed
2 files changed +21
-11
lines changed Original file line number Diff line number Diff line change
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/master/COPYING
3
+
4
+
5
+ from pylint import checkers
6
+ from pylint .lint import PyLinter
7
+ from pylint .testutils .reporter_for_tests import GenericTestReporter
8
+
9
+
10
+ def create_test_linter ():
11
+ test_reporter = GenericTestReporter ()
12
+ linter_ = PyLinter ()
13
+ linter_ .set_reporter (test_reporter )
14
+ linter_ .config .persistent = 0
15
+ checkers .initialize (linter_ )
16
+ return linter_
17
+
18
+
19
+ # Can't be renamed to a constant (easily), it breaks countless tests
20
+ linter = create_test_linter ()
Original file line number Diff line number Diff line change 9
9
from io import StringIO
10
10
from os .path import basename , join , splitext
11
11
12
- from pylint import checkers
13
- from pylint .lint import PyLinter
14
12
from pylint .testutils .constants import SYS_VERS_STR
13
+ from pylint .testutils .global_test_linter import linter
15
14
from pylint .testutils .output_line import Message
16
- from pylint .testutils .reporter_for_tests import GenericTestReporter
17
15
from pylint .utils import ASTWalker
18
16
19
17
@@ -150,13 +148,5 @@ def walk(self, node):
150
148
walker .walk (node )
151
149
152
150
153
- # Init
154
- test_reporter = GenericTestReporter ()
155
- linter = PyLinter ()
156
- linter .set_reporter (test_reporter )
157
- linter .config .persistent = 0
158
- checkers .initialize (linter )
159
-
160
-
161
151
def _tokenize_str (code ):
162
152
return list (tokenize .generate_tokens (StringIO (code ).readline ))
You can’t perform that action at this time.
0 commit comments