Skip to content

Commit

Permalink
Merge branch 'main' into betterwhitelist
Browse files Browse the repository at this point in the history
  • Loading branch information
Laudenlaruto authored Jan 7, 2025
2 parents 6e3c815 + 5967c87 commit 7ab1ab7
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion checks/required_provider_version_operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func RequiredProviderVersionOperatorInModules(modules map[string]data.TerraformM
matched := matcher.MatchString(versionConstraint)
if !matched {
requiredProvidersInError = append(requiredProvidersInError, data.Error{
Path: module.FullPath + requiredProvider.Source,
Path: module.FullPath + " - " + requiredProvider.Source,
LineNumber: -1,
Description: requiredProvider.Source + " --> " + versionConstraint,
})
Expand Down
4 changes: 3 additions & 1 deletion checks/var_number_matches_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ func VarNumberMatchesType(modules map[string]data.TerraformModule) (data.Check,
// Check if prefix is "list"
isCollection := strings.HasPrefix(variable.Type, "list") || strings.HasPrefix(variable.Type, "set") || strings.HasPrefix(variable.Type, "map")
pluralize := pluralize.NewClient()
// Add irregular rules
// If this list gets too big, we should consider moving it to a file or even finding a better way to handle this
pluralize.AddIrregularRule("uri", "uris")

// Remove all spaces and new lines from the type
variable.Type = strings.ReplaceAll(variable.Type, "\n", "")
variable.Type = strings.ReplaceAll(variable.Type, " ", "")

if isCollection && !pluralize.IsPlural(variable.Name) {
variablesInError = append(variablesInError, data.Error{
Path: variable.Pos.Filename,
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/spf13/viper v1.18.2
github.com/zclconf/go-cty v1.14.2
golang.org/x/exp v0.0.0-20240213143201-ec583247a57a
golang.org/x/term v0.17.0
golang.org/x/term v0.28.0
)

require (
Expand Down Expand Up @@ -142,7 +142,7 @@ require (
golang.org/x/net v0.19.0 // indirect
golang.org/x/oauth2 v0.15.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1268,6 +1268,8 @@ golang.org/x/sys v0.5.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.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
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=
Expand All @@ -1278,6 +1280,8 @@ golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
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.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg=
golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek=
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 Down
18 changes: 12 additions & 6 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@
],
"packageRules": [
{
"matchPackagePatterns": ["gomod"],
"groupName": "go"
"groupName": "go",
"matchPackageNames": [
"/gomod/"
]
},
{
"matchPackagePatterns": ["docker"],
"groupName": "docker"
"groupName": "docker",
"matchPackageNames": [
"/docker/"
]
},
{
"matchPackagePatterns": ["github"],
"groupName": "github"
"groupName": "github",
"matchPackageNames": [
"/github/"
]
}
]
}

0 comments on commit 7ab1ab7

Please sign in to comment.