def execute(self): """Check the code with pep257 to find errors """ errors = [] try: for error in pydocstyle.ConventionChecker().check_source( self.code, self.filename): error_code = getattr(error, 'code', None) if error_code is not None and error_code not in self.ignore: errors.append(self._convert(error)) except Exception as error: print(error) return errors
def __init__(self, tree, filename='(none)'): """Placeholder.""" self.tree = tree self.filename = filename self.checker = pep257.ConventionChecker() self.load_source()
def __init__(self, tree, filename, lines): """Placeholder.""" self.tree = tree self.filename = filename self.checker = pep257.ConventionChecker() self.source = ''.join(lines)