Пример #1
0
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)
Пример #2
0
    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
Пример #3
0
    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
Пример #4
0
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)
Пример #5
0
def test_parse_dennis_note(text, expected):
    assert parse_dennis_note(text) == expected
Пример #6
0
def test_parse_dennis_note(text, expected):
    assert parse_dennis_note(text) == expected