configuration: Allow using a list of strings in ignore configuration

This may feel more natural for some users, rather than embedding
multiple entries in a multi-line string.
This commit is contained in:
Matthew Gamble
2023-01-11 04:45:09 +11:00
committed by GitHub
parent 6194a282fc
commit 2a904f8fc1
3 changed files with 99 additions and 9 deletions

View File

@@ -140,7 +140,8 @@ Ignoring paths
--------------
It is possible to exclude specific files or directories, so that the linter
doesn't process them.
doesn't process them. They can be provided either as a list of paths, or as a
bulk string.
You can either totally ignore files (they won't be looked at):
@@ -153,6 +154,13 @@ You can either totally ignore files (they won't be looked at):
all/this/directory/
*.template.yaml
# or:
ignore:
- /this/specific/file.yaml
- all/this/directory/
- '*.template.yaml'
or ignore paths only for specific rules:
.. code-block:: yaml
@@ -165,6 +173,14 @@ or ignore paths only for specific rules:
/this-file-has-trailing-spaces-but-it-is-OK.yaml
/generated/*.yaml
# or:
rules:
trailing-spaces:
ignore:
- /this-file-has-trailing-spaces-but-it-is-OK.yaml
- /generated/*.yaml
Note that this ``.gitignore``-style path pattern allows complex path
exclusion/inclusion, see the `pathspec README file
<https://pypi.python.org/pypi/pathspec>`_ for more details.