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

Implement aliases #3

Closed
cburgdorf opened this issue Sep 13, 2014 · 4 comments
Closed

Implement aliases #3

cburgdorf opened this issue Sep 13, 2014 · 4 comments

Comments

@cburgdorf
Copy link
Contributor

ft(x) should expand to feat(x)
fx(x) should expand to fix(x)
rf(x) should expand to refactor(x)
ch(x) should expand to chore(x)

@0x-r4bbit
Copy link
Contributor

👍

@kbknapp
Copy link
Member

kbknapp commented Apr 24, 2015

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
@kbknapp
Copy link
Member

kbknapp commented Apr 24, 2015

#27 is a bigger one, see the commit message of 44f7d49 for details, should be a good change and very easy to add more aliases from now on ;)

@vyp
Copy link

vyp commented Apr 24, 2015

Since I'm less familiar with the conventional changelog, are these standard aliases?

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants