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
Renamed variable for clarity. Exporting useful regexes. #35
Renamed variable for clarity. Exporting useful regexes. #35
Conversation
Assuming the existing tests exercise this change; LGTM |
LGTM |
revisionSnippet = "(-1|0|[1-9][0-9]*)" | ||
) | ||
|
||
var ( |
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.
Can we please merge this var block with the previous?
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.
merged
SeriesSnippet = "[a-z]+([a-z0-9]+)?" | ||
|
||
// CharmNameSnippet is a regular expression representing charm name | ||
CharmNameSnippet = "[a-z][a-z0-9]*(-[a-z0-9]*[a-z][a-z0-9]*)*" | ||
) | ||
|
||
var validCharmRegEx = regexp.MustCompile("^(" + |
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.
I think this should probably be validCharmURLRegEx.
I think it should also appear above all the component parts. I found it much easier to understand what each regex represents when I saw the whole thing then the snippets
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.
Also I think it belongs in the same var block as the snippets above
LGTM, merge at your leisure. |
Renamed variable for clarity. Exporting useful regexes. Grouped vars in blocks for readability.
Exporting regular expressions for re-use outside of names.
Renamed user validPart for clarity and reusability.