Skip to content
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

Merged
merged 4 commits into from Dec 17, 2014

Conversation

anastasiamac
Copy link
Contributor

Exporting regular expressions for re-use outside of names.
Renamed user validPart for clarity and reusability.

@johnweldon
Copy link
Contributor

Assuming the existing tests exercise this change; LGTM

@waigani
Copy link
Contributor

waigani commented Dec 17, 2014

LGTM

revisionSnippet = "(-1|0|[1-9][0-9]*)"
)

var (
Copy link
Contributor

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?

Copy link
Contributor Author

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("^(" +
Copy link
Contributor

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

Copy link
Contributor

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

@howbazaar
Copy link
Contributor

LGTM, merge at your leisure.

anastasiamac added a commit that referenced this pull request Dec 17, 2014
Renamed variable for clarity. Exporting useful regexes. Grouped vars in blocks for readability.
@anastasiamac anastasiamac merged commit e7394f4 into juju:master Dec 17, 2014
@anastasiamac anastasiamac deleted the charm-url-point-of-truth branch August 3, 2017 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants