112 if code in self.__expected: |
112 if code in self.__expected: |
113 return |
113 return |
114 |
114 |
115 if code and (self.counters[code] == 1 or self.__repeat): |
115 if code and (self.counters[code] == 1 or self.__repeat): |
116 # record the issue with one based line number |
116 # record the issue with one based line number |
117 self.errors.append( |
117 errorInfo = { |
118 { |
118 "file": self.__filename, |
119 "file": self.__filename, |
119 "line": lineNumber + 1, |
120 "line": lineNumber + 1, |
120 "offset": offset, |
121 "offset": offset, |
121 "code": code, |
122 "code": code, |
122 "args": args, |
123 "args": args, |
123 } |
124 } |
124 if errorInfo not in self.errors: |
125 ) |
125 self.errors.append(errorInfo) |
126 |
126 |
127 def run(self): |
127 def run(self): |
128 """ |
128 """ |
129 Public method to check the given source against functions |
129 Public method to check the given source against functions |
130 to be replaced by 'pathlib' equivalents. |
130 to be replaced by 'pathlib' equivalents. |