Skip to content

Commit 7254ee2

Browse files
authored
Merge pull request #29 from myii/chore/standardise-structure
ci(yamllint): add rule `empty-values` & use new `yaml-files` setting
2 parents ff855a1 + 1d418e9 commit 7254ee2

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ jobs:
1616
before_install: skip
1717
script:
1818
# Install and run `yamllint`
19-
- pip install --user yamllint
20-
# yamllint disable-line rule:line-length
21-
- yamllint -s . .yamllint pillar.example
19+
# Need at least `v1.17.0` for the `yaml-files` setting
20+
- pip install --user yamllint>=1.17.0
21+
- yamllint -s .
2222
# Install and run `commitlint`
2323
- npm install @commitlint/config-conventional -D
2424
- npm install @commitlint/travis-cli -D

.yamllint

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,36 @@ 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 Jinja templates under `ssf/files/` (result in `yamllint` syntax errors)
9+
# 2. Any SLS files under directory `test/`, which are actually state files
10+
# 3. All Jinja templates under `ssf/files/` (result in `yamllint` syntax errors)
1011
# Not disabling via. `*.yml` since we may end up with non-Jinja YAML files here
1112
ignore: |
1213
node_modules/
14+
test/**/states/**/*.sls
1315
ssf/files/default/.cirrus.yml
1416
ssf/files/default/.travis.yml
1517
ssf/files/default/.yamllint
1618
ssf/files/default/kitchen.yml
1719
ssf/files/default/inspec/inspec.yml
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:
2031
commas:
2132
# Allow separation between commas to achieve tabular layout under `platforms`
2233
ignore: |
2334
ssf/defaults.yaml
2435
ssf/formulas.yaml
36+
empty-values:
37+
forbid-in-block-mappings: true
38+
forbid-in-flow-mappings: true
2539
line-length:
2640
# Increase from default of `80`
2741
# Based on https://github.com/PyCQA/flake8-bugbear#opinionated-warnings (`B950`)

0 commit comments

Comments
 (0)