-
Notifications
You must be signed in to change notification settings - Fork 43
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
Implement aliases #3
Comments
👍 |
Since I'm less familiar with the conventional changelog, are these standard aliases? If not, perhaps this is something that would go well with #20? Where a user could specify their own aliases. |
kbknapp
added a commit
that referenced
this issue
Apr 24, 2015
Adds aliases where ft expands to feat and fx expands to fix. Closes #3
kbknapp
added a commit
that referenced
this issue
Apr 24, 2015
This is a decent change. Now the CommitType enum is auto-generated via a macro. This macro also implements two helper methods, and one Trait. The helper methods return a Vec<'static str> of all "aliases" for specified variant if called like CommitType::Variant.aliases(). Or if called on the enum itself there the method returns ALL aliases such as CommitType::all_aliases(). The macro also implments the std::str::FromStr trait so you can parse from a string to a known enum type automatically. Say we defined a "feat" or "ft" alias of variant "Feature", if we had a string of "ft" or "feature" we could call some_str.parse::<CommitType>().unwrap() to get a CommitType::Feature, or if it failed to parse we get a CommitType::Unknown Closes #3
kbknapp
added a commit
that referenced
this issue
Apr 24, 2015
This is a decent change. Now the CommitType enum is auto-generated via a macro. This macro also implements two helper methods, and one Trait. The helper methods return a Vec<'static str> of all "aliases" for specified variant if called like CommitType::Variant.aliases(). Or if called on the enum itself there the method returns ALL aliases such as CommitType::all_aliases(). The macro also implments the std::str::FromStr trait so you can parse from a string to a known enum type automatically. Say we defined a "feat" or "ft" alias of variant "Feature", if we had a string of "ft" or "feature" we could call some_str.parse::<CommitType>().unwrap() to get a CommitType::Feature, or if it failed to parse we get a CommitType::Unknown Closes #3
No I do not think so, but I may be wrong. And yes, I think that's a great reason to have a .clog file. |
0x-r4bbit
added
type: feature
effort1: easy (hour)
P4: nice to have
comp: lib
and removed
enhancement
labels
Jul 13, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ft(x)
should expand tofeat(x)
fx(x)
should expand tofix(x)
rf(x)
should expand torefactor(x)
ch(x)
should expand tochore(x)
The text was updated successfully, but these errors were encountered: