def error(self, line_number, offset, text, check):
code = text[:<NUM_LIT:4>]<EOL>if self._ignore_code(code):<EOL><INDENT>return<EOL><DEDENT>if code in self.counters:<EOL><INDENT>self.counters[code] += <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>self.counters[code] = <NUM_LIT:1><EOL>self.messages[code] = text[<NUM_LIT:5>:]<EOL><DEDENT>if code in self.expected:<EOL><INDENT>return<EOL><DEDENT>if self.print_filename and not self.file_errors:<EOL><INDENT>print(self.filename)<EOL><DEDENT>self.file_errors += <NUM_LIT:1><EOL>self.total_errors += <NUM_LIT:1><EOL>return code<EOL>
Report an error, according to options.