ci(travis): run salt-lint during the Lint job

* Automated using https://github.com/myii/ssf-formula/pull/60
* Initially mentioned on Slack (@dafyddj):
  - https://freenode.logbot.info/saltstack-formulas/20191004#c2723464
* Basis for the `git ls-files` invocation (@sblaisot):
  - https://freenode.logbot.info/saltstack-formulas/20191004#c2724272
This commit is contained in:
Imran Iqbal 2019-10-07 23:02:21 +01:00
parent d3b93f81b1
commit 2df46466f6
No known key found for this signature in database
GPG key ID: 6D8629439D2B7819
3 changed files with 19 additions and 1 deletions

13
.salt-lint Normal file
View file

@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
exclude_paths: []
skip_list:
# Using `salt-lint` for linting other files as well, such as Jinja macros/templates
- 205 # Use ".sls" as a Salt State file extension
# Skipping `207` and `208` because `210` is sufficient, at least for the time-being
# I.e. Allows 3-digit unquoted codes to still be used, such as `644` and `755`
- 207 # File modes should always be encapsulated in quotation marks
- 208 # File modes should always contain a leading zero
tags: []
verbosity: 1

View file

@ -27,9 +27,13 @@ jobs:
# Run all of the linters in a single job
- language: node_js
node_js: lts/*
env: 'Lint: yamllint & commitlint'
env: 'Lint: salt-lint, yamllint & commitlint'
before_install: skip
script:
# Install and run `salt-lint`
- pip install --user salt-lint
- git ls-files | grep '\.sls$\|\.jinja$\|\.j2$\|\.tmpl$'
| xargs -I {} salt-lint {}
# Install and run `yamllint`
# Need at least `v1.17.0` for the `yaml-files` setting
- pip install --user yamllint>=1.17.0

View file

@ -17,6 +17,7 @@ yaml-files:
# Default settings
- '*.yaml'
- '*.yml'
- .salt-lint
- .yamllint
# SaltStack Formulas additional settings
- '*.example'