diff --git a/tests/test_spec_examples.py b/tests/test_spec_examples.py index f3e9239..5d41c26 100644 --- a/tests/test_spec_examples.py +++ b/tests/test_spec_examples.py @@ -54,8 +54,8 @@ conf_general = ('document-start: disable\n' 'braces: {min-spaces-inside: 1, max-spaces-inside: 1}\n' 'brackets: {min-spaces-inside: 1, max-spaces-inside: 1}\n') conf_overrides = { - 'example-2.2': ('colons: {max-spaces-after: 2}\n'), - 'example-2.4': ('colons: {max-spaces-after: 3}\n'), + 'example-2.2': 'colons: {max-spaces-after: 2}\n', + 'example-2.4': 'colons: {max-spaces-after: 3}\n', 'example-2.5': ('empty-lines: {max-end: 2}\n' 'brackets: {min-spaces-inside: 0, max-spaces-inside: 2}\n' 'commas: {max-spaces-before: -1}\n'), @@ -63,65 +63,65 @@ conf_overrides = { 'indentation: disable\n'), 'example-2.12': ('empty-lines: {max-end: 1}\n' 'colons: {max-spaces-before: -1}\n'), - 'example-2.16': ('empty-lines: {max-end: 1}\n'), - 'example-2.18': ('empty-lines: {max-end: 1}\n'), - 'example-2.19': ('empty-lines: {max-end: 1}\n'), - 'example-2.28': ('empty-lines: {max-end: 3}\n'), + 'example-2.16': 'empty-lines: {max-end: 1}\n', + 'example-2.18': 'empty-lines: {max-end: 1}\n', + 'example-2.19': 'empty-lines: {max-end: 1}\n', + 'example-2.28': 'empty-lines: {max-end: 3}\n', 'example-5.3': ('indentation: {indent-sequences: false}\n' 'colons: {max-spaces-before: 1}\n'), - 'example-6.4': ('trailing-spaces: disable\n'), - 'example-6.5': ('trailing-spaces: disable\n'), - 'example-6.6': ('trailing-spaces: disable\n'), - 'example-6.7': ('trailing-spaces: disable\n'), - 'example-6.8': ('trailing-spaces: disable\n'), + 'example-6.4': 'trailing-spaces: disable\n', + 'example-6.5': 'trailing-spaces: disable\n', + 'example-6.6': 'trailing-spaces: disable\n', + 'example-6.7': 'trailing-spaces: disable\n', + 'example-6.8': 'trailing-spaces: disable\n', 'example-6.10': ('empty-lines: {max-end: 2}\n' 'trailing-spaces: disable\n' 'comments-indentation: disable\n'), 'example-6.11': ('empty-lines: {max-end: 1}\n' 'comments-indentation: disable\n'), - 'example-6.13': ('comments-indentation: disable\n'), - 'example-6.14': ('comments-indentation: disable\n'), - 'example-6.23': ('colons: {max-spaces-before: 1}\n'), + 'example-6.13': 'comments-indentation: disable\n', + 'example-6.14': 'comments-indentation: disable\n', + 'example-6.23': 'colons: {max-spaces-before: 1}\n', 'example-7.4': ('colons: {max-spaces-before: 1}\n' 'indentation: disable\n'), - 'example-7.5': ('trailing-spaces: disable\n'), - 'example-7.6': ('trailing-spaces: disable\n'), - 'example-7.7': ('indentation: disable\n'), + 'example-7.5': 'trailing-spaces: disable\n', + 'example-7.6': 'trailing-spaces: disable\n', + 'example-7.7': 'indentation: disable\n', 'example-7.8': ('colons: {max-spaces-before: 1}\n' 'indentation: disable\n'), - 'example-7.9': ('trailing-spaces: disable\n'), + 'example-7.9': 'trailing-spaces: disable\n', 'example-7.11': ('colons: {max-spaces-before: 1}\n' 'indentation: disable\n'), 'example-7.13': ('brackets: {min-spaces-inside: 0, max-spaces-inside: 1}\n' 'commas: {max-spaces-before: 1, min-spaces-after: 0}\n'), - 'example-7.14': ('indentation: disable\n'), + 'example-7.14': 'indentation: disable\n', 'example-7.15': ('braces: {min-spaces-inside: 0, max-spaces-inside: 1}\n' 'commas: {max-spaces-before: 1, min-spaces-after: 0}\n' 'colons: {max-spaces-before: 1}\n'), - 'example-7.16': ('indentation: disable\n'), - 'example-7.17': ('indentation: disable\n'), - 'example-7.18': ('indentation: disable\n'), - 'example-7.19': ('indentation: disable\n'), + 'example-7.16': 'indentation: disable\n', + 'example-7.17': 'indentation: disable\n', + 'example-7.18': 'indentation: disable\n', + 'example-7.19': 'indentation: disable\n', 'example-7.20': ('colons: {max-spaces-before: 1}\n' 'indentation: disable\n'), - 'example-8.1': ('empty-lines: {max-end: 1}\n'), - 'example-8.2': ('trailing-spaces: disable\n'), + 'example-8.1': 'empty-lines: {max-end: 1}\n', + 'example-8.2': 'trailing-spaces: disable\n', 'example-8.5': ('comments-indentation: disable\n' 'trailing-spaces: disable\n'), - 'example-8.6': ('empty-lines: {max-end: 1}\n'), - 'example-8.7': ('empty-lines: {max-end: 1}\n'), - 'example-8.8': ('trailing-spaces: disable\n'), - 'example-8.9': ('empty-lines: {max-end: 1}\n'), - 'example-8.14': ('colons: {max-spaces-before: 1}\n'), - 'example-8.16': ('indentation: {spaces: 1}\n'), - 'example-8.17': ('indentation: disable\n'), + 'example-8.6': 'empty-lines: {max-end: 1}\n', + 'example-8.7': 'empty-lines: {max-end: 1}\n', + 'example-8.8': 'trailing-spaces: disable\n', + 'example-8.9': 'empty-lines: {max-end: 1}\n', + 'example-8.14': 'colons: {max-spaces-before: 1}\n', + 'example-8.16': 'indentation: {spaces: 1}\n', + 'example-8.17': 'indentation: disable\n', 'example-8.20': ('indentation: {indent-sequences: false}\n' 'colons: {max-spaces-before: 1}\n'), - 'example-8.22': ('indentation: disable\n'), - 'example-10.1': ('colons: {max-spaces-before: 2}\n'), - 'example-10.2': ('indentation: {indent-sequences: false}\n'), - 'example-10.8': ('truthy: disable\n'), - 'example-10.9': ('truthy: disable\n'), + 'example-8.22': 'indentation: disable\n', + 'example-10.1': 'colons: {max-spaces-before: 2}\n', + 'example-10.2': 'indentation: {indent-sequences: false}\n', + 'example-10.8': 'truthy: disable\n', + 'example-10.9': 'truthy: disable\n', } files = os.listdir(os.path.join(os.path.dirname(os.path.realpath(__file__)), diff --git a/yamllint/linter.py b/yamllint/linter.py index aaf43e5..9ee40a0 100644 --- a/yamllint/linter.py +++ b/yamllint/linter.py @@ -75,7 +75,7 @@ def get_cosmetic_problems(buffer, conf, filepath): for rule in token_rules: context[rule.ID] = {} - class DisableDirective(): + class DisableDirective: def __init__(self): self.rules = set() self.all_rules = set([r.ID for r in rules])