Skip to content

Commit

Permalink
refactor(travis): use pathspecs for git ls-files instead of grep
Browse files Browse the repository at this point in the history
* Apply suggestion received here:
  - saltstack-formulas/template-formula#181 (comment)
  • Loading branch information
myii committed Nov 27, 2019
1 parent f52eb37 commit 615e3b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
script:
# Install and run `salt-lint`
- pip install --user salt-lint
- git ls-files | grep '\.sls$\|\.jinja$\|\.j2$\|\.tmpl$\|\.tst$'
| xargs salt-lint
- git ls-files -- *.sls *.jinja *.j2 *.tmpl *.tst
| xargs salt-lint
# Install and run `yamllint`
# Need at least `v1.17.0` for the `yaml-files` setting
- pip install --user yamllint>=1.17.0
Expand All @@ -40,8 +40,8 @@ jobs:
- rubocop -d
# Run `shellcheck` (already pre-installed in Travis)
- shellcheck --version
- git ls-files | grep '\.sh$\|\.bash$\|\.ksh$'
| xargs shellcheck
- git ls-files -- *.sh *.bash *.ksh
| xargs shellcheck
# Install and run `commitlint`
- npm i -D @commitlint/config-conventional
@commitlint/travis-cli
Expand Down
8 changes: 4 additions & 4 deletions ssf/files/default/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ jobs:
{%- endif %}
# Install and run `salt-lint`
- {{ pip_cmd }} install --user salt-lint
- git ls-files | grep '\.sls$\|\.jinja$\|\.j2$\|\.tmpl$\|\.tst$'
| xargs salt-lint
- git ls-files -- *.sls *.jinja *.j2 *.tmpl *.tst
| xargs salt-lint
# Install and run `yamllint`
# Need at least `v1.17.0` for the `yaml-files` setting
- {{ pip_cmd }} install --user yamllint>=1.17.0
Expand All @@ -139,8 +139,8 @@ jobs:
{%- endif %}
# Run `shellcheck` (already pre-installed in Travis)
- shellcheck --version
- git ls-files | grep '\.sh$\|\.bash$\|\.ksh$'
| xargs shellcheck
- git ls-files -- *.sh *.bash *.ksh
| xargs shellcheck
# Install and run `commitlint`
- npm i -D @commitlint/config-conventional
@commitlint/travis-cli
Expand Down

0 comments on commit 615e3b2

Please sign in to comment.