Skip to content

Commit

Permalink
dev-infrastructure: parallelize fmt, lint
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Kuznetsov <[email protected]>
  • Loading branch information
stevekuznetsov committed Dec 19, 2024
1 parent 40e7b30 commit a6d978d
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions dev-infrastructure/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,18 @@ list:
@grep '^[^#[:space:]].*:' Makefile
.PHONY: list

fmt:
set -e; \
FILES="$$(find . -type f -name "*.bicep*" ! -name "*.tmpl.bicepparam")"; \
for file in $$FILES; do \
echo "az bicep format --file $${file}"; \
az bicep format --file $$file; \
done
.PHONY: fmt

lint:
set -e; \
FILES="$$(find . -type f -name "*.bicep*" ! -name "*.tmpl.bicepparam")"; \
for file in $$FILES; do \
echo "az bicep lint --file $${file}"; \
az bicep lint --file $$file; \
done
.PHONY: lint
modules := $(wildcard ./templates/*.bicep)
parameters := $(filter-out $(wildcard ./templates/*.tmpl.bicepparam),$(wildcard ./templates/*.bicepparam))

fmt: $(modules:.bicep=.bicep.fmt) $(parameters:.bicepparam=.biceparam.fmt)

lint: $(modules:.bicep=.bicep.lint) $(parameters:.bicepparam=.biceparam.lint)

%.bicep.fmt %.bicepparam.fmt:
az bicep format --file $(basename $@)

%.bicep.lint %.bicepparam.lint:
az bicep lint --file $(basename $@)

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

0 comments on commit a6d978d

Please sign in to comment.