Skip to content

Commit

Permalink
rules/sdk: exempt "core", "runtime" from map iteration checks
Browse files Browse the repository at this point in the history
Noticed in a bunch of cosmos-sdk patterns that "runtime" is a package
that heavily uses maps for proto and file descriptor manipulation so
let's excuse it from map range checks; same thing for "core"
  • Loading branch information
odeke-em committed Nov 5, 2022
1 parent 0e4655d commit f3d05e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rules/sdk/iterate_over_maps.go
Expand Up @@ -41,7 +41,7 @@ func (mr *mapRanging) ID() string {
// so return true if we detect such.
func pkgExcusedFromMapRangingChecks(ctx *gosec.Context) bool {
switch pkg := ctx.Pkg.Name(); pkg {
case "gogoreflection", "simapp", "simulation", "testutil":
case "core", "gogoreflection", "proto", "runtime", "simapp", "simulation", "testutil":
return true
default:
return false
Expand Down

0 comments on commit f3d05e8

Please sign in to comment.