Skip to content

Commit

Permalink
fix: fmt and lint commands were not executed in the env's context
Browse files Browse the repository at this point in the history
Right now fmt and lint tasks would only apply to ./*.tf files, by
using the wrapper script we make sure to execute the lint in the
environment's context.
  • Loading branch information
paulRbr committed May 1, 2020
1 parent 3e1f009 commit b05969c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,12 @@ endif
@bash $(dir $(mkfile_path))/terraform.sh init $(args)

.PHONY: fmt
fmt:
@terraform fmt $(args) $(RUN_ARGS)
fmt: ## Rewrites config to canonical format
@bash $(dir $(mkfile_path))/terraform.sh fmt $(args)

.PHONY: lint
lint: ## Rewrites config to canonical format
@terraform fmt -diff=true -check $(args) $(RUN_ARGS)
lint: ## Lint the HCL code
@bash $(dir $(mkfile_path))/terraform.sh fmt -diff=true -check $(args) $(RUN_ARGS)

.PHONY: validate
validate: ## Basic syntax check
Expand Down

0 comments on commit b05969c

Please sign in to comment.