Skip to content

Commit

Permalink
feat(travis): run shellcheck during lint job
Browse files Browse the repository at this point in the history
  • Loading branch information
myii committed Nov 27, 2019
1 parent 1ea7fbb commit f52eb37
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- language: 'node_js'
node_js: 'lts/*'
env: 'Lint'
name: 'Lint: salt-lint, yamllint, rubocop & commitlint'
name: 'Lint: salt-lint, yamllint, rubocop, shellcheck & commitlint'
before_install: 'skip'
script:
# Install and run `salt-lint`
Expand All @@ -38,6 +38,10 @@ jobs:
# Install and run `rubocop`
- gem install rubocop
- rubocop -d
# Run `shellcheck` (already pre-installed in Travis)
- shellcheck --version
- git ls-files | grep '\.sh$\|\.bash$\|\.ksh$'
| xargs shellcheck
# Install and run `commitlint`
- npm i -D @commitlint/config-conventional
@commitlint/travis-cli
Expand Down
4 changes: 2 additions & 2 deletions ssf/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
8 changes: 6 additions & 2 deletions ssf/files/default/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ fast_finish: true

{#- Prepare variables used for linters #}
{%- set comment_linters = '# Run all of the linters in a single job' %}
{%- set name_linters = 'Lint: salt-lint, yamllint, rubocop & commitlint' %}
{%- set name_linters = 'Lint: salt-lint, yamllint, rubocop, shellcheck & commitlint' %}
{%- if not travis.use_single_job_for_linters %}
{%- set comment_linters = comment_linters ~ ' (except `rubocop`)' %}
{%- set name_linters = 'Lint: salt-lint, yamllint & commitlint' %}
{%- set name_linters = 'Lint: salt-lint, yamllint, shellcheck & commitlint' %}
{%- endif %}
{#- Prepare variable used for `saltcheck` #}
{%- set use_saltcheck = False %}
Expand Down Expand Up @@ -137,6 +137,10 @@ jobs:
{%- if travis.use_single_job_for_linters %}
{{- format_rubocop_linter() }}
{%- endif %}
# Run `shellcheck` (already pre-installed in Travis)
- shellcheck --version
- git ls-files | grep '\.sh$\|\.bash$\|\.ksh$'
| xargs shellcheck
# Install and run `commitlint`
- npm i -D @commitlint/config-conventional
@commitlint/travis-cli
Expand Down

0 comments on commit f52eb37

Please sign in to comment.