Skip to content
Snippets Groups Projects
Commit da185381 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 @@
- id: check-added-large-files
- id: check-yaml
- 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:
- directories:
- $HOME/.pre-commit
addons:
apt:
sources:
- sourceline: 'deb http://archive.ubuntu.com/ubuntu trusty-backports main universe multiverse'
packages:
- shellcheck
install:
- pip install pre_commit
......
0.5.0
\ No newline at end of file
0.5.1
\ No newline at end of file
......@@ -2,9 +2,8 @@
- id: shell-lint
name: Lint shell scripts
description: Run /bin/sh -en against shell scripts.
language: system
entry: /usr/bin/env
args: ['-i', '/bin/sh', '-en']
language: script
entry: ./shell-lint
files: &shell_scripts \.(sh|bash|ksh|zsh)$
- id: shellcheck
name: shellcheck
......
#!/bin/sh
set -eu
for filename in "$@"
do
/usr/bin/env -i /bin/sh "$filename"
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment