Skip to content

Commit

Permalink
provider: update terrafmt checks with make terrafmt command
Browse files Browse the repository at this point in the history
  • Loading branch information
katbyte committed Apr 21, 2020
1 parent 50bb45e commit e046da5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ func resourceArmVirtualNetwork() *schema.Resource {
Type: schema.TypeSet,
Optional: true,
Computed: true,
ConfigMode: schema.SchemaConfigModeAttr,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": {
Expand Down
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 e046da5

Please sign in to comment.