-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix lint issues in util #183
Conversation
Reduce execution time of ConvertComponentIdIntoFriendlyPathSearch by 50-60% and add benchmark Signed-off-by: Nicholas Jackson <[email protected]>
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #183 +/- ##
==========================================
- Coverage 99.75% 99.75% -0.01%
==========================================
Files 149 149
Lines 10822 10821 -1
==========================================
- Hits 10796 10794 -2
- Misses 26 27 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Hmmm why did coverage go down on an unrelated file? I'll take a look later... |
@@ -573,8 +574,7 @@ func ConvertComponentIdIntoFriendlyPathSearch(id string) (string, string) { | |||
|
|||
// check for strange spaces, chars and if found, wrap them up, clean them and create a new cleaned path. | |||
for i := range segs { | |||
pathCharExp, _ := regexp.MatchString("[%=;~.]", segs[i]) | |||
if pathCharExp { | |||
if pathCharExp.Match([]byte(segs[i])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! yeah all these regexes should always be pre-compiled, I must have been rushing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I ignore any off by one code coverage results |
Also reduce execution time of ConvertComponentIdIntoFriendlyPathSearch by 50-60% and add benchmark
Lint issues fixed: