-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (26 loc) · 758 Bytes
/
Makefile
File metadata and controls
31 lines (26 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
.PHONY: format format-check syntax-check lint test
format:
@echo "Formatting shell scripts in script/..."
@shfmt -w -i 2 -ci -bn script/
format-check:
@echo "Checking shell script formatting..."
@shfmt -d -i 2 -ci -bn script/
syntax-check:
@echo "Checking bash syntax..."
@for file in script/*; do \
if [ -f "$$file" ] && [ -x "$$file" ]; then \
echo " Checking $$file"; \
bash -n "$$file" || exit 1; \
fi \
done
@echo "All scripts have valid bash syntax!"
lint:
@echo "Linting shell scripts..."
@for file in script/*; do \
if [ -f "$$file" ] && [ -x "$$file" ]; then \
echo " Checking $$file"; \
shellcheck -x "$$file" || exit 1; \
fi \
done
@echo "All scripts passed shellcheck!"
test: syntax-check lint format-check