Skip to content

Commit 0f7fd4a

Browse files
Update linting script
- Replace bin/lint with pre-commit implementatino
1 parent c3fcba7 commit 0f7fd4a

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

bin/lint

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,21 @@
22

33
set -e
44

5-
bin/rubocop --autocorrect-all $*
6-
yarn prettier --write --list-different --ignore-unknown ${*:-'**/*'}
7-
bin/bundle exec rufo ${*:-app}
8-
if [ -z "$*" ]; then
9-
bin/brakeman --quiet --no-summary --no-pager
10-
terraform fmt -recursive
5+
6+
usage() {
7+
echo "Usage: $0 <pre-commit-run-args>"
8+
echo "For pre-commit documentation run \`pre-commit run --help\`"
9+
}
10+
11+
if [ "$1" = "--help" ]; then
12+
usage
13+
exit 0
14+
fi
15+
16+
if [ -z "$1" ]; then
17+
echo "No arguments provided. Running pre-commit with default arguments."
18+
pre-commit run --all-files
1119
else
12-
terraform fmt $*
20+
echo "Running pre-commit with provided arguments: $@"
21+
pre-commit run "$@"
1322
fi
14-
tflint --chdir=terraform --init
15-
tflint --chdir=terraform --recursive

0 commit comments

Comments
 (0)