config: Look for configuration file in parent directories

Inspired be ESLint's search, it looks for configuration files in all
parent directories up until it reaches the user's home or root.

closes #571
This commit is contained in:
Georgi Georgiev
2023-05-23 00:59:56 +09:00
committed by GitHub
parent 019c87d36d
commit e636848ddc
3 changed files with 79 additions and 7 deletions

View File

@@ -15,7 +15,8 @@ If ``-c`` is not provided, yamllint will look for a configuration file in the
following locations (by order of preference):
- a file named ``.yamllint``, ``.yamllint.yaml``, or ``.yamllint.yml`` in the
current working directory
current working directory, or a parent directory (the search for this file is
terminated at the user's home or filesystem root)
- a filename referenced by ``$YAMLLINT_CONFIG_FILE``, if set
- a file named ``$XDG_CONFIG_HOME/yamllint/config`` or
``~/.config/yamllint/config``, if present