Skip to content

Commit d74dfe7

Browse files
committed
Add lint script for local development
1 parent 4884c93 commit d74dfe7

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

.github/workflows/workflow.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ jobs:
5555
run: brew install shfmt
5656

5757
- name: Run shfmt
58-
run: shfmt -d .
58+
run: shfmt -i 2 -d .

scripts/lint

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
3+
# Unoffical Bash "strict mode"
4+
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
5+
set -euo pipefail
6+
#ORIGINAL_IFS=$IFS
7+
IFS=$'\t\n' # Stricter IFS settings
8+
9+
# This script exists to make linting during local development easy. These checks
10+
# are identical to the ones run by the Github workflow.
11+
12+
# Run shellcheck on Bash scripts
13+
shellcheck bin/* scripts/*
14+
15+
# Run formatter
16+
shfmt -i 2 -d .

0 commit comments

Comments
 (0)