vet: adds a check to disallow usage of regex.Compile in xDS code - #9216
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9216 +/- ##
==========================================
- Coverage 83.19% 83.16% -0.04%
==========================================
Files 420 420
Lines 34010 34024 +14
==========================================
Hits 28295 28295
- Misses 4281 4288 +7
- Partials 1434 1441 +7 🚀 New features to boost your workflow:
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds a static analysis check in scripts/vet.sh to prevent direct calls to regexp.Compile in xDS production code. The reviewer suggested extending this check to also disallow regexp.MustCompile to ensure complete safety, providing a code suggestion to implement this using git grep's -e and --or flags.
|
|
||
|
|
There was a problem hiding this comment.
nit: A single blank line is sufficient for vertical separation.
There was a problem hiding this comment.
Added by mistake. Cleaned it up. Thank you!
Fixes : #9153
This PR adds a check to disallow usage of regex.Compile in xDS code.
Excludes the following from check :
SafeRegexfunction liveshashPoliciesProtoToSliceneeds to use it becuase it requires partial matches too , to replace the substring.RELEASE NOTES: None