Skip to content

Commit

Permalink
Merge pull request #3 from danmx/args
Browse files Browse the repository at this point in the history
add(lint,args): shell linters and args support
  • Loading branch information
muffix authored Apr 30, 2020
2 parents 990b04b + 20e8140 commit 84bd521
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
10 changes: 10 additions & 0 deletions .editconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[*.sh]
# like -i=4
indent_style = space
indent_size = 4

shell_variant = posix # like -ln=posix
binary_next_line = true # like -bn
switch_case_indent = true # like -ci
space_redirects = true # like -sr
keep_padding = true # like -kp
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ repos:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 2.0.1
hooks:
- id: shellcheck
- id: shfmt
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ A collection of pre-commit hooks for [https://github.com/pre-commit/pre-commit](

- **kapitan-compile**: Compiles [Kapitan](https://kapitan.dev) templates

## Development dependencies

- [shellcheck](https://www.shellcheck.net/)
- [shfmt](https://github.com/mvdan/sh)
8 changes: 4 additions & 4 deletions hooks/kapitan-compile.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#!/bin/sh

set -e

docker run -t --rm -v "$(pwd)":/src:delegated deepmind/kapitan:0.27.2 compile
set -eu

# shellcheck disable=SC2068
docker run -t --rm -v "${PWD}":/src:delegated deepmind/kapitan:0.27.2 compile $@

0 comments on commit 84bd521

Please sign in to comment.