Skip to content

Commit

Permalink
ci(travis): run linters using pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dafyddj committed Jul 27, 2020
1 parent c78c068 commit 6da26cc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@
# See https://pre-commit.com/hooks.html for more hooks
default_stages: [commit]
repos:
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v2.2.3
- repo: https://github.com/dafyddj/commitlint-pre-commit-hook
rev: v2.3.0
hooks:
- id: commitlint
name: Check commit message against @commitlint/config-conventional rules
name: Check commit message using commitlint
description: Lint commit message against @commitlint/config-conventional rules
stages: [commit-msg]
additional_dependencies: ['@commitlint/config-conventional@8.3.4']
- id: commitlint-travis
stages: [manual]
additional_dependencies: ['@commitlint/config-conventional@8.3.4']
always_run: true
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 2.1.3
hooks:
Expand Down
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
# Run all of the linters in a single job
- language: 'node_js'
node_js: 'lts/*'
cache:
directories:
- $HOME/.cache/pre-commit
env: 'Lint'
name: 'Lint: salt-lint, yamllint, rubocop, shellcheck & commitlint'
before_install: 'skip'
Expand All @@ -54,6 +57,10 @@ jobs:
- npm i -D @commitlint/config-conventional
@commitlint/travis-cli
- commitlint-travis
# Install and run `pre-commit`
- pip install pre-commit
- pre-commit run --all-files --verbose
- pre-commit run --hook-stage manual --verbose commitlint-travis

## Define the rest of the matrix based on Kitchen testing
# Make sure the instances listed below match up with
Expand Down

0 comments on commit 6da26cc

Please sign in to comment.