Skip to content

Commit f3d05e8

Browse files
committed
rules/sdk: exempt "core", "runtime" from map iteration checks
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"
1 parent 0e4655d commit f3d05e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rules/sdk/iterate_over_maps.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func (mr *mapRanging) ID() string {
4141
// so return true if we detect such.
4242
func pkgExcusedFromMapRangingChecks(ctx *gosec.Context) bool {
4343
switch pkg := ctx.Pkg.Name(); pkg {
44-
case "gogoreflection", "simapp", "simulation", "testutil":
44+
case "core", "gogoreflection", "proto", "runtime", "simapp", "simulation", "testutil":
4545
return true
4646
default:
4747
return false

0 commit comments

Comments
 (0)