Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 55212e0

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

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ jobs:
4040
before_install: skip
4141
script:
4242
# Install and run `yamllint`
43-
- pip install --user yamllint
44-
# yamllint disable-line rule:line-length
45-
- yamllint -s . .yamllint pillar.example test/salt/pillar/repositories.pillar.sls test/salt/pillar/preferences.pillar.sls
43+
# Need at least `v1.17.0` for the `yaml-files` setting
44+
- pip install --user yamllint>=1.17.0
45+
- yamllint -s .
4646
# Install and run `commitlint`
4747
- npm install @commitlint/config-conventional -D
4848
- npm install @commitlint/travis-cli -D

.yamllint

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,24 @@ extends: default
66

77
# Files to ignore completely
88
# 1. All YAML files under directory `node_modules/`, introduced during the Travis run
9+
# 2. Any SLS files under directory `test/`, which are actually state files
910
ignore: |
1011
node_modules/
12+
test/**/states/**/*.sls
13+
14+
yaml-files:
15+
# Default settings
16+
- '*.yaml'
17+
- '*.yml'
18+
- .yamllint
19+
# SaltStack Formulas additional settings
20+
- '*.example'
21+
- test/**/*.sls
1122

1223
rules:
24+
empty-values:
25+
forbid-in-block-mappings: true
26+
forbid-in-flow-mappings: true
1327
line-length:
1428
# Increase from default of `80`
1529
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)

0 commit comments

Comments
 (0)