Skip to content

Commit

Permalink
provider: update terrafmt checks with make terrafmt command (#6567)
Browse files Browse the repository at this point in the history
  • Loading branch information
katbyte authored Apr 22, 2020
1 parent 6f1c795 commit 7cee42e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions scripts/terrafmt-acctests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ if ${error}; then
echo "The preceding files contain terraform blocks that are not correctly formatted or contain errors."
echo "You can fix this by running make tools and then terrafmt on them."
echo ""
echo "format a single file:"
echo "$ terrafmt fmt -f ./azurerm/internal/services/service/tests/resource_test.go"
echo "to easily fix all terraform blocks:"
echo "$ make terrafmt"
echo ""
echo "format all website files:"
echo "format only acceptance test config blocks:"
echo "$ find azurerm | egrep \"_test.go\" | sort | while read f; do terrafmt fmt -f \$f; done"
echo ""
echo "format a single test file:"
echo "$ terrafmt fmt -f ./azurerm/internal/services/service/tests/resource_test.go"
echo ""
echo "on windows:"
echo "$ Get-ChildItem -Path . -Recurse -Filter \"*_test.go\" | foreach {terrafmt fmt -f $_.fullName}"
echo ""
Expand Down
9 changes: 6 additions & 3 deletions scripts/terrafmt-website.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ if ${error}; then
echo "The preceding files contain terraform blocks that are not correctly formatted or contain errors."
echo "You can fix this by running make tools and then terrafmt on them."
echo ""
echo "format a single file:"
echo "$ terrafmt fmt ./website/path/to/file.html.markdown"
echo "to easily fix all terraform blocks:"
echo "$ make terrafmt"
echo ""
echo "format all website files:"
echo "format only website config blocks:"
echo "$ find . | egrep html.markdown | sort | while read f; do terrafmt fmt \$f; done"
echo ""
echo "format a single website file:"
echo "$ terrafmt fmt ./website/path/to/file.html.markdown"
echo ""
echo "on windows:"
echo "$ Get-ChildItem -Path . -Recurse -Filter \"*html.markdown\" | foreach {terrafmt fmt $_.fullName}"
echo ""
Expand Down

0 comments on commit 7cee42e

Please sign in to comment.