def test_parse_dennis_note(): data = [('', []), ('Foo', []), ('Foo bar', []), ('dennis-ignore', []), ('dennis-ignore: *', '*'), ('dennis-ignore: E101', ['E101']), ('dennis-ignore: E101, E102', ['E101']), ('dennis-ignore: E101,E102', ['E101', 'E102']), ('localizers ignore this: dennis-ignore: E101,E102', ['E101', 'E102'])] for text, expected in data: eq_(parse_dennis_note(text), expected)
def lint_poentry(self, poentry): linted_entry = LintedEntry(poentry) skip = parse_dennis_note(poentry.comment) # Check the comment to see if what we should ignore. for lint_rule in self.rules: if skip == '*' or lint_rule.num in skip: continue lint_rule.lint(self.vartok, linted_entry) return linted_entry
def lint_poentry(self, poentry): linted_entry = LintedEntry(poentry) skip = parse_dennis_note(poentry.comment) msgs = [] # Check the comment to see if what we should ignore. for lint_rule in self.rules: if skip == '*' or lint_rule.num in skip: continue msgs.extend(lint_rule.lint(self.vartok, linted_entry)) return msgs
def test_parse_dennis_note(): data = [ ('', []), ('Foo', []), ('Foo bar', []), ('dennis-ignore', []), ('dennis-ignore: *', '*'), ('dennis-ignore: E101', ['E101']), ('dennis-ignore: E101, E102', ['E101']), ('dennis-ignore: E101,E102', ['E101', 'E102']), ('localizers ignore this: dennis-ignore: E101,E102', ['E101', 'E102']) ] for text, expected in data: eq_(parse_dennis_note(text), expected)
def test_parse_dennis_note(text, expected): assert parse_dennis_note(text) == expected