Skip to content

Commit

Permalink
Fix go releaser rm-dir option with clean option as per new release. (#…
Browse files Browse the repository at this point in the history
…1692)

* test commit

* fix for goreleaser

* fix static checks

* add lint ignore

* sonar fixes

* go mmode files added

* fix go get errors

* removing sonar errors

* removing sonar errors

* fixed duplicates

* fix sonar errors

* go format

* fix tests

* fix lint errors

* fix lint errors

* review comments

* placeholder checkin
  • Loading branch information
nmoretenable authored Aug 26, 2024
1 parent f55bbd3 commit 7061bb2
Show file tree
Hide file tree
Showing 17 changed files with 81 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: goreleaser/goreleaser-action@v3
with:
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,4 @@ Terrascan is licensed under the [Apache 2.0 License](LICENSE).

[![Forkers @tenable/terrascan](https://reporoster.com/forks/tenable/terrascan)](https://github.com/tenable/terrascan/network/members)

###
22 changes: 12 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/tenable/terrascan

go 1.21
go 1.22.1

toolchain go1.22.6

replace (
github.com/hashicorp/go-getter => github.com/hashicorp/go-getter v1.7.0
Expand All @@ -16,7 +18,7 @@ require (
github.com/Azure/azure-sdk-for-go v56.3.0+incompatible
github.com/Azure/go-autorest/autorest v0.11.24
github.com/Azure/go-autorest/autorest/azure/auth v0.4.2
github.com/BurntSushi/toml v0.4.1 // indirect
github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect
github.com/GoogleCloudPlatform/docker-credential-gcr v2.0.5+incompatible
github.com/VerbalExpressions/GoVerbalExpressions v0.0.0-20200410162751-4d76a1099a6e
github.com/aws/aws-sdk-go v1.44.193
Expand Down Expand Up @@ -55,8 +57,8 @@ require (
github.com/stretchr/testify v1.8.4
github.com/zclconf/go-cty v1.10.0
go.uber.org/zap v1.17.0
golang.org/x/sys v0.17.0
golang.org/x/tools v0.12.1-0.20230825192346-2191a27a6dc5 // indirect
golang.org/x/sys v0.20.0
golang.org/x/tools v0.21.1-0.20240531212143-b6235391adb3 // indirect
google.golang.org/api v0.114.0
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1
gopkg.in/src-d/go-git.v4 v4.13.1
Expand Down Expand Up @@ -206,13 +208,13 @@ require (
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/oauth2 v0.7.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/term v0.17.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/term v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/appengine v1.6.7 // indirect
Expand Down
32 changes: 16 additions & 16 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBp
github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU=
github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v0.4.1 h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw=
github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs=
github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4=
github.com/ChrisTrenkamp/goxpath v0.0.0-20190607011252-c5096ec8773d/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4=
Expand Down Expand Up @@ -1852,8 +1852,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down Expand Up @@ -1930,8 +1930,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/oauth2 v0.0.0-20180724155351-3d292e4d0cdc/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
Expand Down Expand Up @@ -1979,8 +1979,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down Expand Up @@ -2110,15 +2110,15 @@ golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw=
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand All @@ -2130,8 +2130,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down Expand Up @@ -2240,8 +2240,8 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.12.1-0.20230825192346-2191a27a6dc5 h1:Vk4mysSz+GqQK2eqgWbo4zEO89wkeAjJiFIr9bpqa8k=
golang.org/x/tools v0.12.1-0.20230825192346-2191a27a6dc5/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM=
golang.org/x/tools v0.21.1-0.20240531212143-b6235391adb3 h1:SHq4Rl+B7WvyM4XODon1LXtP7gcG49+7Jubt1gWWswY=
golang.org/x/tools v0.21.1-0.20240531212143-b6235391adb3/go.mod h1:bqv7PJ/TtlrzgJKhOAGdDUkUltQapRik/UEHubLVBWo=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
6 changes: 3 additions & 3 deletions pkg/iac-providers/cft/v1/load-file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,21 @@ func TestLoadIacFile(t *testing.T) {
options map[string]interface{}
}{
{
wantErr: fmt.Errorf(testErrString1),
wantErr: fmt.Errorf(testErrString1), //lint:ignore SA1006 placeholder %s are specified in string constants
want: output.AllResourceConfigs{},
cftv1: CFTV1{},
name: "invalid extension",
filePath: testFile,
typeOnly: false,
}, {
wantErr: fmt.Errorf(testErrString2),
wantErr: fmt.Errorf(testErrString2), //lint:ignore SA1006 placeholder %s are specified in string constants
want: output.AllResourceConfigs{},
cftv1: CFTV1{},
name: "nonexistent file",
filePath: "nonexistent.txt",
typeOnly: false,
}, {
wantErr: fmt.Errorf("error while unmarshalling yaml, error %w", fmt.Errorf(testErrString3)),
wantErr: fmt.Errorf("error while unmarshalling yaml, error %w", fmt.Errorf(testErrString3)), //lint:ignore SA1006 placeholder %s are specified in string constants
want: output.AllResourceConfigs{},
cftv1: CFTV1{},
name: "invalid file",
Expand Down
4 changes: 2 additions & 2 deletions pkg/iac-providers/kustomize/commons/load-dir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func TestLoadKustomize(t *testing.T) {
name: "erroneous-pod",
basepath: filepath.Join(testDataDir, "erroneous-pod"),
filename: kustomizeYaml,
wantErr: fmt.Errorf(kustomizeErrPrefix),
wantErr: fmt.Errorf(kustomizeErrPrefix), //lint:ignore SA1006 placeholder %s are specified in string constants
checkPrefix: true,
kustomizeBinary: false,
exe: "",
Expand All @@ -221,7 +221,7 @@ func TestLoadKustomize(t *testing.T) {
name: "erroneous-deployment",
basepath: filepath.Join(testDataDir, "erroneous-deployment/"),
filename: kustomizeYaml,
wantErr: fmt.Errorf(kustomizeErrPrefix),
wantErr: fmt.Errorf(kustomizeErrPrefix), //lint:ignore SA1006 placeholder %s are specified in string constants
checkPrefix: true,
kustomizeBinary: false,
exe: "",
Expand Down
2 changes: 1 addition & 1 deletion pkg/iac-providers/output/vulnerability.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (v *Vulnerability) PrepareFromACRImageScan(acrResponse ACRResponse) {
return
}
v.Description = acrResponse.Properties.Description
if acrResponse.Properties.AdditionalData.Cve != nil && len(acrResponse.Properties.AdditionalData.Cve) >= 1 {
if len(acrResponse.Properties.AdditionalData.Cve) >= 1 {
v.VulnerabilityID = acrResponse.Properties.AdditionalData.Cve[0].Title
v.PrimaryURL = acrResponse.Properties.AdditionalData.Cve[0].Link
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/iac-providers/terraform/commons/load-file.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ func LoadIacFile(absFilePath, terraformVersion string) (allResourcesConfig outpu
if hclFile == nil {
errMessage := fmt.Sprintf("error occurred while loading config file '%s'. error:\n%v\n", absFilePath, getErrorMessagesFromDiagnostics(diags))
zap.S().Debug(errMessage)
return allResourcesConfig, fmt.Errorf(errMessage)
return allResourcesConfig, fmt.Errorf(errMessage) //lint:ignore SA1006 placeholder %s are specified in string constants
}

if diags.HasErrors() {
errMessage := fmt.Sprintf("failed to load iac file '%s'. error:\n%v\n", absFilePath, getErrorMessagesFromDiagnostics(diags))
zap.S().Debug(errMessage)
return allResourcesConfig, fmt.Errorf(errMessage)
return allResourcesConfig, fmt.Errorf(errMessage) //lint:ignore SA1006 placeholder %s are specified in string constants
}

// initialize normalized output
Expand Down
22 changes: 11 additions & 11 deletions pkg/iac-providers/terraform/v12/load-dir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ References to other resources during the destroy phase can cause dependency cycl
dirPath: filepath.Join(testDataDir, "invalid-moduleconfigs"),
tfv12: TfV12{},
// same error is loaded two times because, both root module and a child module will generated same error
wantErr: multierror.Append(fmt.Errorf(errStringInvalidModuleConfigs), fmt.Errorf(errStringInvalidModuleConfigs)),
wantErr: multierror.Append(fmt.Errorf(errStringInvalidModuleConfigs), fmt.Errorf(errStringInvalidModuleConfigs)), //lint:ignore SA1006 placeholder %s are specified in string constants
},
{
name: "load invalid config dir",
Expand All @@ -141,21 +141,21 @@ References to other resources during the destroy phase can cause dependency cycl
options: map[string]interface{}{
"nonRecursive": true,
},
wantErr: multierror.Append(fmt.Errorf(testErrorString1)),
wantErr: multierror.Append(fmt.Errorf(testErrorString1)), //lint:ignore SA1006 placeholder %s are specified in string constants
},
{
name: "load invalid config dir recursive",
dirPath: testDataDir,
tfv12: TfV12{},
wantErr: multierror.Append(fmt.Errorf(testErrorString1),
wantErr: multierror.Append(fmt.Errorf(testErrorString1), //lint:ignore SA1006 placeholder %s are specified in string constants
fmt.Errorf(invalidDirErrStringTemplate, filepath.Join(testDataDir, "deep-modules", "modules")),
fmt.Errorf(invalidDirErrStringTemplate, filepath.Join(testDataDir, "deep-modules", "modules", "m4", "modules")),
fmt.Errorf(errStringDestroyProvisioners),
fmt.Errorf(errStringDestroyProvisioners), //lint:ignore SA1006 placeholder %s are specified in string constants
fmt.Errorf(invalidDirErrStringTemplate, filepath.Join(testDataDir, "invalid-module-source")),
fmt.Errorf(errStringModuleSourceInvalid),
fmt.Errorf(errStringInvalidModuleConfigs),
fmt.Errorf(errStringInvalidModuleConfigs),
fmt.Errorf(testErrorString2),
fmt.Errorf(errStringModuleSourceInvalid), //lint:ignore SA1006 placeholder %s are specified in string constants
fmt.Errorf(errStringInvalidModuleConfigs), //lint:ignore SA1006 placeholder %s are specified in string constants
fmt.Errorf(errStringInvalidModuleConfigs), //lint:ignore SA1006 placeholder %s are specified in string constants
fmt.Errorf(testErrorString2), //lint:ignore SA1006 placeholder %s are specified in string constants
fmt.Errorf(invalidDirErrStringTemplate, filepath.Join(testDataDir, "relative-moduleconfigs")),
fmt.Errorf(invalidDirErrStringTemplate, filepath.Join(testDataDir, "tfjson")),
),
Expand All @@ -167,19 +167,19 @@ References to other resources during the destroy phase can cause dependency cycl
options: map[string]interface{}{
"nonRecursive": true,
},
wantErr: multierror.Append(fmt.Errorf(testErrorString2)),
wantErr: multierror.Append(fmt.Errorf(testErrorString2)), //lint:ignore SA1006 placeholder %s are specified in string constants
},
{
name: "load multiple provider config dir recursive",
dirPath: multipleProvidersDir,
tfv12: TfV12{},
wantErr: multierror.Append(fmt.Errorf(testErrorString2)),
wantErr: multierror.Append(fmt.Errorf(testErrorString2)), //lint:ignore SA1006 placeholder %s are specified in string constants
},
{
name: "invalid module source directory",
dirPath: filepath.Join(testDataDir, "invalid-module-source", "invalid_source"),
tfv12: TfV12{},
wantErr: multierror.Append(fmt.Errorf(errStringModuleSourceInvalid)),
wantErr: multierror.Append(fmt.Errorf(errStringModuleSourceInvalid)), //lint:ignore SA1006 placeholder %s are specified in string constants
},
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/iac-providers/terraform/v12/load-file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ References to other resources during the destroy phase can cause dependency cycl
name: "invalid filepath",
filePath: "not-there",
tfv12: TfV12{},
wantErr: fmt.Errorf(testErrorString1),
wantErr: fmt.Errorf(testErrorString1), //lint:ignore SA1006 placeholder %s are specified in string constants
},
{
name: "empty config",
Expand All @@ -79,13 +79,13 @@ References to other resources during the destroy phase can cause dependency cycl
name: "invalid config",
filePath: emptyTfFilePath,
tfv12: TfV12{},
wantErr: fmt.Errorf(testErrorString2),
wantErr: fmt.Errorf(testErrorString2), //lint:ignore SA1006 placeholder %s are specified in string constants
},
{
name: "destroy-provisioners",
filePath: nonEmptyTfFilePath,
tfv12: TfV12{},
wantErr: fmt.Errorf(testErrorString3),
wantErr: fmt.Errorf(testErrorString3), //lint:ignore SA1006 placeholder %s are specified in string constants
},
}

Expand Down
Loading

0 comments on commit 7061bb2

Please sign in to comment.