File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -31,17 +31,18 @@ class PEP257(PythonLinter):
3131 line_col_base = (1 , 0 ) # pep257 uses one-based line and zero-based column numbers
3232 tempfile_suffix = 'py'
3333 module = 'pep257'
34+ check_version = True
3435
35- @classmethod
36- def initialize (cls ):
37- """Initialize a PEP257Checker() object, to be re-used on every check()."""
38- super ().initialize ()
39- cls ._checker = cls .module .PEP257Checker ()
36+ # Internal
37+ checker = None
4038
4139 def check (self , code , filename ):
4240 """Run pep257 on code and return the output."""
41+ if self .checker is None :
42+ self .checker = self .module .PEP257Checker ()
43+
4344 errors = []
44- for error in self ._checker .check_source (code , os .path .basename (filename )):
45+ for error in self .checker .check_source (code , os .path .basename (filename )):
4546 if getattr (error , 'code' , None ) is not None :
4647 errors .append (str (error ))
4748
You can’t perform that action at this time.
0 commit comments