67 super().__init__(options) |
67 super().__init__(options) |
68 |
68 |
69 self.__repeat = options.repeat |
69 self.__repeat = options.repeat |
70 self.errors = [] |
70 self.errors = [] |
71 |
71 |
72 def error_args(self, line_number, offset, errorCode, check, *args): |
72 def error_args(self, line_number, offset, text, _check, *args): |
73 """ |
73 """ |
74 Public method to collect the error messages. |
74 Public method to collect the error messages. |
75 |
75 |
76 @param line_number line number of the issue |
76 @param line_number line number of the issue |
77 @type int |
77 @type int |
78 @param offset position within line of the issue |
78 @param offset position within line of the issue |
79 @type int |
79 @type int |
80 @param errorCode error message code |
80 @param text issue message code or issue text |
81 @type str |
81 @type str |
82 @param check reference to the checker function |
82 @param _check reference to the checker function |
83 @type function |
83 @type function |
84 @param args arguments for the message |
84 @param args arguments for the message |
85 @type list |
85 @type list |
86 @return error code |
86 @return error code |
87 @rtype str |
87 @rtype str |
88 """ |
88 """ |
89 errorCode = super().error_args(line_number, offset, errorCode, check, *args) |
89 code = text.split(None, 1)[0] |
|
90 errorCode = code[0] + "-" + code[1:] |
|
91 if self._ignore_code(errorCode): |
|
92 return None |
|
93 if errorCode in self.counters: |
|
94 self.counters[errorCode] += 1 |
|
95 else: |
|
96 self.counters[errorCode] = 1 |
|
97 # Don't care about expected errors or warnings |
|
98 if errorCode in self.expected: |
|
99 return None |
90 if errorCode and (self.counters[errorCode] == 1 or self.__repeat): |
100 if errorCode and (self.counters[errorCode] == 1 or self.__repeat): |
91 self.errors.append( |
101 self.errors.append( |
92 { |
102 { |
93 "file": self.filename, |
103 "file": self.filename, |
94 "line": line_number, |
104 "line": line_number, |