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

Altering conventions (e.g., add "sty" for "style" or "enh" as an alternative to "feat") #48

Open
oesteban opened this issue Jun 29, 2023 · 5 comments

Comments

@oesteban
Copy link
Contributor

Is your feature request related to a problem? Please describe.
The CLI currently allows little room for flexibility on the convention side. Either being able to provide custom conventions or a utility to add prefixes to sections would be very much appreciated.

@pawamoy
Copy link
Owner

pawamoy commented Jun 29, 2023

OK for the feature, I can review PRs if you're willing to send one 🙂

@oesteban
Copy link
Contributor Author

I'll gladly contribute, specially after seeing your responsiveness :)

Question before I dive in. Here:

TYPES: dict[str, str] = {
"build": "Build",
"chore": "Chore",
"ci": "Continuous Integration",
"deps": "Dependencies",
"doc": "Docs",
"docs": "Docs",
"feat": "Features",
"fix": "Bug Fixes",
"perf": "Performance Improvements",
"ref": "Code Refactoring",
"refactor": "Code Refactoring",
"revert": "Reverts",
"style": "Style",
"test": "Tests",
"tests": "Tests",
}
I can see that the commit types are set in the dict, and then the keys are joined together within the regex.

A naive approach would be adding the new keywords and associating them to existing sections, however this is bound to fail since you want to have a single id for the section.

Would it make sense to change this dictionary to tuples of section tuple and lists/tuples of regex tokens like ("Features", ("feat", "enh")]) or ("Style", ("sty(le)?[:\]\ ]")?

@pawamoy
Copy link
Owner

pawamoy commented Jun 29, 2023

I'm not sure to understand. If you look at the dict, you'll see that we can have multiple keys (commit type) for the same value (section title), for example test and tests for "Tests", or ref and refactor for "Code Refactoring". Could we not add "sty": "Style" and "enh": "Features" to the dict dynamically?

@oesteban
Copy link
Contributor Author

Right, sorry for my sloppiness when looking at it. Good I asked - then this PR can focus on enabling the CLI to have a language for these additions.

@pawamoy
Copy link
Owner

pawamoy commented Jun 29, 2023

No worries! Yep, sounds right 🙂

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

No branches or pull requests

2 participants