mirror of
https://github.com/saltstack-formulas/salt-formula.git
synced 2026-10-06 08:08:38 +02:00
test(pre-commit): switch to using pre-commit's built-in file filtering
* only run `yamllint` when relevant files have changed * avoids having to exclude files/dirs not tracked by Git e.g. .kitchen/, .bundle/ etc. * avoids a `yamllint` bug whereby pillar files under `test/` were not checked due to a conflicting `ignore` entry
This commit is contained in:
1 parent
1ca9120974
commit
be66375cb7
2 files changed
+27
-34
No files matched your search
+27
-3
@@ -45,9 +45,33 @@ repos:
|
||||
hooks:
|
||||
- id: yamllint
|
||||
name: Check YAML syntax with yamllint
|
||||
args: [--strict, '.']
|
||||
always_run: true
|
||||
pass_filenames: false
|
||||
args: [--strict]
|
||||
types: [file]
|
||||
# Files to include
|
||||
# 1. Obvious YAML files
|
||||
# 2. `pillar.example` and similar files
|
||||
# 3. SLS files under directory `test/` which are pillar files
|
||||
# Files to exclude
|
||||
# 1. SLS files under directory `test/` which are state files
|
||||
# 2. `kitchen.vagrant.yml`, which contains Embedded Ruby (ERB) template syntax
|
||||
# 3. YAML files heavily reliant on Jinja
|
||||
files: |
|
||||
(?x)^(
|
||||
.*\.yaml|
|
||||
.*\.yml|
|
||||
\.salt-lint|
|
||||
\.yamllint|
|
||||
.*\.example|
|
||||
test/.*\.sls
|
||||
)$
|
||||
exclude: |
|
||||
(?x)^(
|
||||
kitchen.vagrant.yml|
|
||||
test/.*/states/.*\.sls|
|
||||
salt/osfamilymap.yaml|
|
||||
salt/osmap.yaml|
|
||||
salt/osfingermap.yaml
|
||||
)$
|
||||
- repo: https://github.com/warpnet/salt-lint
|
||||
rev: v0.9.2
|
||||
hooks:
|
||||
|
||||
Reference in new issue
Block a user