@@ -23,16 +23,45 @@ TEST_COUNT ?= 1
23
23
# - docs/makefile-cheat-sheet.md
24
24
# - docs/continuous-integration.md
25
25
26
+ # VARIABLE REFERENCE:
27
+ # Service-specific variables (interchangeable for user convenience):
28
+ # PKG=<service> - Service name (e.g., ses, lambda, s3) - traditional usage
29
+ # K=<service> - Service name (e.g., ses, lambda, s3) - shorter alias
30
+ #
31
+ # Test-specific variables:
32
+ # T=<pattern> - Test name pattern (e.g., TestAccLambda) - preferred
33
+ # TESTS=<pattern> - Test name pattern - legacy alias for T
34
+ #
35
+ # Derived variables (set automatically based on above):
36
+ # PKG_NAME - Full package path (e.g., internal/service/ses)
37
+ # SVC_DIR - Service directory path (e.g., ./internal/service/ses)
38
+ # TEST - Test path pattern (e.g., ./internal/service/ses/...)
39
+ #
40
+ # Examples:
41
+ # make quick-fix PKG=ses # Fix code in SES service
42
+ # make quick-fix K=lambda # Same as above, but shorter (both work)
43
+ # make t T=TestAccRole PKG=iam # Run specific test in IAM service
44
+
45
+ # Variable consolidation for backward compatibility and user convenience:
46
+ # - PKG and K both refer to service names (e.g., 'ses', 'lambda')
47
+ # - If one is provided, automatically set the other for consistency
48
+ # - This allows 'make quick-fix PKG=ses' and 'make quick-fix K=ses' to work identically
26
49
ifneq ($(origin PKG ) , undefined)
27
50
PKG_NAME = internal/service/$(PKG)
28
51
SVC_DIR = ./internal/service/$(PKG)
29
52
TEST = ./$(PKG_NAME)/...
53
+ # Auto-set K for compatibility
54
+ K = $(PKG)
30
55
endif
31
56
32
57
ifneq ($(origin K ) , undefined)
33
58
PKG_NAME = internal/service/$(K)
34
- SVC_DIR = ./internal/service/$(PKG )
59
+ SVC_DIR = ./internal/service/$(K )
35
60
TEST = ./$(PKG_NAME)/...
61
+ # Auto-set PKG for compatibility (only if not already set)
62
+ ifeq ($(origin PKG), undefined)
63
+ PKG = $(K)
64
+ endif
36
65
endif
37
66
38
67
ifneq ($(origin TESTS ) , undefined)
@@ -383,9 +412,11 @@ provider-lint: ## [CI] ProviderLint Checks / providerlint
383
412
-XS002=false \
384
413
$(SVC_DIR ) /... ./internal/provider/...
385
414
386
- quick-fix : fmt testacc-lint-fix fix-imports modern-fix semgrep-fix # # Some quick fixes
415
+ quick-fix-heading : # # Just a heading for quick-fix
387
416
@echo " make: Quick fixes..."
388
417
418
+ quick-fix : quick-fix-heading fmt testacc-lint-fix fix-imports modern-fix semgrep-fix website-terrafmt-fix # # Some quick fixes
419
+
389
420
provider-markdown-lint : # # [CI] Provider Check / markdown-lint
390
421
@echo " make: Provider Check / markdown-lint..."
391
422
@docker run --rm \
@@ -838,6 +869,15 @@ website-terrafmt: ## [CI] Website Checks / terrafmt
838
869
@echo " make: Website Checks / terrafmt..."
839
870
@terrafmt diff ./website --check --pattern ' *.markdown'
840
871
872
+ website-terrafmt-fix : # # [CI] Fix Website / terrafmt
873
+ @echo " make: Fix Website / terrafmt..."
874
+ @echo " make: terrafmt fix website/docs root files..."
875
+ @find ./website/docs -maxdepth 1 -type f -name ' *.markdown' -exec terrafmt fmt {} \;
876
+ @for dir in $$(find ./website/docs -maxdepth 1 -type d ! -name docs ! -name cdktf | sort ) ; do \
877
+ echo " make: Fixing $$ dir with terrafmt..." ; \
878
+ terrafmt fmt $$ dir --pattern ' *.markdown' ; \
879
+ done
880
+
841
881
website-tflint : tflint-init # # [CI] Website Checks / tflint
842
882
@echo " make: Website Checks / tflint..."
843
883
@exit_code=0 ; \
@@ -941,6 +981,7 @@ yamllint: ## [CI] YAML Linting / yamllint
941
981
provider-lint \
942
982
provider-markdown-lint \
943
983
quick-fix \
984
+ quick-fix-heading \
944
985
sane \
945
986
sanity \
946
987
semgrep \
@@ -989,5 +1030,6 @@ yamllint: ## [CI] YAML Linting / yamllint
989
1030
website-markdown-lint \
990
1031
website-misspell \
991
1032
website-terrafmt \
1033
+ website-terrafmt-fix \
992
1034
website-tflint \
993
1035
yamllint
0 commit comments