Skip to content

Commit 9796319

Browse files
committed
ci(yamllint): add rule empty-values & use new yaml-files setting
* Automated using myii/ssf-formula#27
1 parent 6e0245a commit 9796319

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

.travis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ jobs:
5656
before_install: skip
5757
script:
5858
# Install and run `yamllint`
59-
- pip install --user yamllint
60-
# yamllint disable-line rule:line-length
61-
- yamllint -s . .yamllint pillar.example test/salt/pillar/postgres.sls
59+
# Need at least `v1.17.0` for the `yaml-files` setting
60+
- pip install --user yamllint>=1.17.0
61+
- yamllint -s .
6262
# Install and run `commitlint`
6363
- npm install @commitlint/config-conventional -D
6464
- npm install @commitlint/travis-cli -D

.yamllint

+15-1
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,31 @@ extends: default
66

77
# Files to ignore completely
88
# 1. All YAML files under directory `node_modules/`, introduced during the Travis run
9-
# 2. All YAML files heavily reliant on Jinja; these can be tackled in a subsequent PR
9+
# 2. Any SLS files under directory `test/`, which are actually state files
10+
# 3. All YAML files heavily reliant on Jinja; these can be tackled in a subsequent PR
1011
ignore: |
1112
node_modules/
13+
test/**/states/**/*.sls
1214
pillar.example
1315
postgres/codenamemap.yaml
1416
postgres/osfamilymap.yaml
1517
postgres/osmap.yaml
1618
postgres/repo.yaml
1719
test/salt/pillar/postgres.sls
1820
21+
yaml-files:
22+
# Default settings
23+
- '*.yaml'
24+
- '*.yml'
25+
- .yamllint
26+
# SaltStack Formulas additional settings
27+
- '*.example'
28+
- test/**/*.sls
29+
1930
rules:
31+
empty-values:
32+
forbid-in-block-mappings: true
33+
forbid-in-flow-mappings: true
2034
line-length:
2135
# Increase from default of `80`
2236
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)

0 commit comments

Comments
 (0)