mirror of
https://github.com/saltstack-formulas/template-formula.git
synced 2025-04-17 10:10:28 +00:00
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:
parent
d3b93f81b1
commit
2df46466f6
3 changed files with 19 additions and 1 deletions
13
.salt-lint
Normal file
13
.salt-lint
Normal 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
|
|
@ -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
|
||||
|
|
|
@ -17,6 +17,7 @@ yaml-files:
|
|||
# Default settings
|
||||
- '*.yaml'
|
||||
- '*.yml'
|
||||
- .salt-lint
|
||||
- .yamllint
|
||||
# SaltStack Formulas additional settings
|
||||
- '*.example'
|
||||
|
|
Loading…
Add table
Reference in a new issue