diff --git a/docs/configuration.rst b/docs/configuration.rst index 8ae3cc8..5e00169 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -14,7 +14,8 @@ To use a custom configuration file, use the ``-c`` option: If ``-c`` is not provided, yamllint will look for a configuration file in the following locations (by order of preference): -- ``.yamllint`` in the current working directory +- ``.yamllint``, ``.yamllint.yaml`` or ``.yamllint.yml`` in the current working + directory - ``$XDG_CONFIG_HOME/yamllint/config`` - ``~/.config/yamllint/config`` diff --git a/yamllint/cli.py b/yamllint/cli.py index d8f4927..0ffaae4 100644 --- a/yamllint/cli.py +++ b/yamllint/cli.py @@ -154,6 +154,10 @@ def run(argv=None): conf = YamlLintConfig(file=args.config_file) elif os.path.isfile('.yamllint'): conf = YamlLintConfig(file='.yamllint') + elif os.path.isfile('.yamllint.yaml'): + conf = YamlLintConfig(file='.yamllint.yaml') + elif os.path.isfile('.yamllint.yml'): + conf = YamlLintConfig(file='.yamllint.yml') elif os.path.isfile(user_global_config): conf = YamlLintConfig(file=user_global_config) else: