Skip to content

Commit a6d978d

Browse files
dev-infrastructure: parallelize fmt, lint
Signed-off-by: Steve Kuznetsov <[email protected]>
1 parent 40e7b30 commit a6d978d

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

dev-infrastructure/Makefile

+12-17
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,18 @@ list:
2727
@grep '^[^#[:space:]].*:' Makefile
2828
.PHONY: list
2929

30-
fmt:
31-
set -e; \
32-
FILES="$$(find . -type f -name "*.bicep*" ! -name "*.tmpl.bicepparam")"; \
33-
for file in $$FILES; do \
34-
echo "az bicep format --file $${file}"; \
35-
az bicep format --file $$file; \
36-
done
37-
.PHONY: fmt
38-
39-
lint:
40-
set -e; \
41-
FILES="$$(find . -type f -name "*.bicep*" ! -name "*.tmpl.bicepparam")"; \
42-
for file in $$FILES; do \
43-
echo "az bicep lint --file $${file}"; \
44-
az bicep lint --file $$file; \
45-
done
46-
.PHONY: lint
30+
modules := $(wildcard ./templates/*.bicep)
31+
parameters := $(filter-out $(wildcard ./templates/*.tmpl.bicepparam),$(wildcard ./templates/*.bicepparam))
32+
33+
fmt: $(modules:.bicep=.bicep.fmt) $(parameters:.bicepparam=.biceparam.fmt)
34+
35+
lint: $(modules:.bicep=.bicep.lint) $(parameters:.bicepparam=.biceparam.lint)
36+
37+
%.bicep.fmt %.bicepparam.fmt:
38+
az bicep format --file $(basename $@)
39+
40+
%.bicep.lint %.bicepparam.lint:
41+
az bicep lint --file $(basename $@)
4742

4843
feature-registration: # hardcoded to eastus as this is a subscription deployment, not a resource group
4944
@az deployment sub create \

0 commit comments

Comments
 (0)