33# modify it under the terms of the GNU General Public License
44# as published by the Free Software Foundation; either version 2
55# of the License, or (at your option) any later version.
6- #
6+ #
77# This program is distributed in the hope that it will be useful,
88# but WITHOUT ANY WARRANTY; without even the implied warranty of
99# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1010# GNU General Public License for more details.
11- #
11+ #
1212# You should have received a copy of the GNU General Public License
1313# along with this program. If not, see <http://www.gnu.org/licenses/>.
1414#
1515.PHONY : all security lint format documentation documentation-examples validate-all validate validate-examples init examples tests
1616
1717default : all
1818
19- all :
19+ all :
2020 $(MAKE ) init
2121 $(MAKE ) validate
2222 $(MAKE ) tests
@@ -34,15 +34,15 @@ examples:
3434 $(MAKE ) format
3535 $(MAKE ) documentation
3636
37- documentation :
37+ documentation :
3838 @echo " --> Generating documentation"
3939 @terraform-docs .
4040 $(MAKE ) documentation-modules
4141 $(MAKE ) documentation-examples
4242
4343documentation-modules :
4444 @echo " --> Generating documentation for modules"
45- @find . -type d -regex ' .*/modules/[a-za-z\-_$$ ]*' -not -path ' *.terraform*' 2> /dev/null | while read -r dir; do \
45+ @find . -type d -regex ' .*/modules/[a-za-z\-\_ ]*' -not -path ' *.terraform*' 2> /dev/null | while read -r dir; do \
4646 echo " --> Generating documentation for module: $$ dir" ; \
4747 terraform-docs $$ dir; \
4848 done ;
@@ -67,7 +67,7 @@ upgrade-terraform-example-providers:
6767 done ; \
6868 fi
6969
70- init :
70+ init :
7171 @echo " --> Running terraform init"
7272 @terraform init -backend=false
7373 @find . -type f -name " *.tf" -not -path ' *.terraform*' -exec dirname {} \; | sort -u | while read -r dir; do \
@@ -87,7 +87,7 @@ security-modules:
8787 echo " --> Validating $$ dir" ; \
8888 terraform init -backend=false; \
8989 trivy config --format table --exit-code 1 --severity CRITICAL,HIGH --ignorefile .trivyignore $$ dir; \
90- done ;
90+ done ;
9191
9292security-examples :
9393 @echo " --> Running Security checks on examples"
@@ -97,8 +97,8 @@ security-examples:
9797 trivy config --format table --exit-code 1 --severity CRITICAL,HIGH --ignorefile .trivyignore $$ dir; \
9898 done ;
9999
100- tests :
101- @echo " --> Running Terraform Tests"
100+ tests :
101+ @echo " --> Running Terraform Tests"
102102 @terraform test
103103
104104validate :
@@ -111,7 +111,7 @@ validate:
111111
112112validate-modules :
113113 @echo " --> Running terraform validate on modules"
114- @find . -type d -regex ' .* /modules/[a-zA-Z\-_$$ ]*' -not -path ' *.terraform*' 2> /dev/null | while read -r dir; do \
114+ @find . -type d -regex ' ./modules/[a-zA-Z\-]*' -not -path ' *.terraform*' 2> /dev/null | while read -r dir; do \
115115 echo " --> Validating Module $$ dir" ; \
116116 terraform -chdir=$$ dir init -backend=false; \
117117 terraform -chdir=$$ dir validate; \
@@ -123,7 +123,7 @@ validate-examples:
123123 echo " --> Validating $$ dir" ; \
124124 terraform -chdir=$$ dir init -backend=false; \
125125 terraform -chdir=$$ dir validate; \
126- done ;
126+ done ;
127127
128128validate-commits :
129129 @echo " --> Running commitlint against the main branch"
@@ -132,7 +132,7 @@ validate-commits:
132132
133133lint :
134134 @echo " --> Running tflint"
135- @tflint --init
135+ @tflint --init
136136 @tflint -f compact
137137 $(MAKE ) lint-modules
138138 $(MAKE ) lint-examples
@@ -151,9 +151,9 @@ lint-examples:
151151 echo " --> Linting $$ dir" ; \
152152 tflint --chdir=$$ dir --init; \
153153 tflint --chdir=$$ dir -f compact; \
154- done ;
154+ done ;
155155
156- format :
156+ format :
157157 @echo " --> Running terraform fmt"
158158 @terraform fmt -recursive -write=true
159159
0 commit comments