From 3bf311c9bf86a83bcea679aaaf286423c536148a Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Wed, 27 Nov 2019 13:34:37 +0000 Subject: [PATCH] feat(travis): run `shellcheck` during lint job * https://github.com/saltstack-formulas/template-formula/pull/180#issuecomment-558612422 --- .travis.yml | 3 +++ ssf/defaults.yaml | 4 ++-- ssf/files/default/.travis.yml | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6eaad65f..29f4d224 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,9 @@ jobs: name: 'Lint: salt-lint, yamllint, rubocop & commitlint' before_install: 'skip' script: + # Run `shellcheck` + - git ls-files | grep '\.sh$\|\.bash$\|\.ksh$' + | xargs shellcheck # Install and run `salt-lint` - pip install --user salt-lint - git ls-files | grep '\.sls$\|\.jinja$\|\.j2$\|\.tmpl$\|\.tst$' diff --git a/ssf/defaults.yaml b/ssf/defaults.yaml index 48e7fb48..21a21798 100644 --- a/ssf/defaults.yaml +++ b/ssf/defaults.yaml @@ -22,8 +22,8 @@ ssf_node_anchors: # An alternative method could be to use: # `git describe --abbrev=0 --tags` # yamllint disable rule:line-length - title: 'ci(travis): use default matrix after `centos-6` image fix' - body: '* Automated using https://github.com/myii/ssf-formula/pull/105' + title: 'ci(travis): run `shellcheck` during lint job [skip ci]' + body: '* Automated using https://github.com/myii/ssf-formula/pull/106' # yamllint enable rule:line-length github: owner: 'saltstack-formulas' diff --git a/ssf/files/default/.travis.yml b/ssf/files/default/.travis.yml index 0b9fa9e1..94afd177 100644 --- a/ssf/files/default/.travis.yml +++ b/ssf/files/default/.travis.yml @@ -118,6 +118,9 @@ jobs: name: '{{ name_linters }}' before_install: 'skip' script: + # Run `shellcheck` + - git ls-files | grep '\.sh$\|\.bash$\|\.ksh$' + | xargs shellcheck {#- Prepare variable used for `pip` #} {%- set pip_cmd = 'pip' %} {%- if semrel_formula == 'ufw' %}