def test_tabs(self): lines = [" b", "\tabc", "efg", "\t\tc"] check = checks.CheckIndentationNoTab({}) errors = [] for line in lines: errors.extend(check.report_iter(line)) self.assertEqual(2, len(errors)) (code, msg) = errors[0] self.assertIn(code, check.REPORTS)
def fetch_checks(cfg): base = [ checks.CheckValidity(cfg), checks.CheckTrailingWhitespace(cfg), checks.CheckIndentationNoTab(cfg), checks.CheckCarriageReturn(cfg), checks.CheckMaxLineLength(cfg), checks.CheckNewlineEndOfFile(cfg), ] mgr = extension.ExtensionManager( namespace="doc8.extension.check", invoke_on_load=True, invoke_args=(cfg.copy(),) ) addons = [] for e in mgr: addons.append(e.obj) return base + addons