diff --git a/docs/configuration.rst b/docs/configuration.rst index f7f8ffa6..8ae3cc8f 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -126,6 +126,7 @@ configuration option. The default is: yaml-files: - '*.yaml' - '*.yml' + - '.yamllint' The same rules as for ignoring paths apply (``.gitignore``-style path pattern, see below). diff --git a/tests/test_config.py b/tests/test_config.py index d6763828..b48546c9 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -448,11 +448,13 @@ def test_run_with_ignored_path(self): out = sys.stdout.getvalue() out = '\n'.join(sorted(out.splitlines())) + docstart = '[warning] missing document start "---" (document-start)' keydup = '[error] duplication of key "key" in mapping (key-duplicates)' trailing = '[error] trailing spaces (trailing-spaces)' hyphen = '[error] too many spaces after hyphen (hyphens)' self.assertEqual(out, '\n'.join(( + './.yamllint:1:1: ' + docstart, './bin/file.lint-me-anyway.yaml:3:3: ' + keydup, './bin/file.lint-me-anyway.yaml:4:17: ' + trailing, './bin/file.lint-me-anyway.yaml:5:5: ' + hyphen, diff --git a/yamllint/conf/default.yaml b/yamllint/conf/default.yaml index f0c1eddf..dc4adf18 100644 --- a/yamllint/conf/default.yaml +++ b/yamllint/conf/default.yaml @@ -3,6 +3,7 @@ yaml-files: - '*.yaml' - '*.yml' + - '.yamllint' rules: braces: enable diff --git a/yamllint/config.py b/yamllint/config.py index a9384d6c..0837799f 100644 --- a/yamllint/config.py +++ b/yamllint/config.py @@ -33,7 +33,7 @@ def __init__(self, content=None, file=None): self.ignore = None self.yaml_files = pathspec.PathSpec.from_lines( - 'gitwildmatch', ['*.yaml', '*.yml']) + 'gitwildmatch', ['*.yaml', '*.yml', '.yamllint']) if file is not None: with open(file) as f: