Skip to content
Snippets Groups Projects
Commit 524af209 authored by nimrod's avatar nimrod
Browse files

- Corrected issue with shell-lint hook, the hook only checked the first

script listed.
- Bumped patch version.
- Added pre-commit hooks to test the shell-lint script added.
parent cac4e3fa
No related branches found
No related tags found
No related merge requests found
...@@ -5,3 +5,10 @@ ...@@ -5,3 +5,10 @@
- id: check-added-large-files - id: check-added-large-files
- id: check-yaml - id: check-yaml
- id: check-merge-conflict - id: check-merge-conflict
- repo: https://www.shore.co.il/git/shell-pre-commit/
sha: v0.5.0
hooks:
- id: shell-lint
files: shell-lint
- id: shellcheck
files: shell-lint
...@@ -9,6 +9,13 @@ cache: ...@@ -9,6 +9,13 @@ cache:
- directories: - directories:
- $HOME/.pre-commit - $HOME/.pre-commit
addons:
apt:
sources:
- sourceline: 'deb http://archive.ubuntu.com/ubuntu trusty-backports main universe multiverse'
packages:
- shellcheck
install: install:
- pip install pre_commit - pip install pre_commit
......
0.5.0 0.5.1
\ No newline at end of file \ No newline at end of file
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
- id: shell-lint - id: shell-lint
name: Lint shell scripts name: Lint shell scripts
description: Run /bin/sh -en against shell scripts. description: Run /bin/sh -en against shell scripts.
language: system language: script
entry: /usr/bin/env entry: ./shell-lint
args: ['-i', '/bin/sh', '-en']
files: &shell_scripts \.(sh|bash|ksh|zsh)$ files: &shell_scripts \.(sh|bash|ksh|zsh)$
- id: shellcheck - id: shellcheck
name: shellcheck name: shellcheck
......
#!/bin/sh
set -eu
for filename in "$@"
do
/usr/bin/env -i /bin/sh -en "$filename"
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment