-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
feat: Customizing code convention #60
base: main
Are you sure you want to change the base?
feat: Customizing code convention #60
Conversation
Issue: pawamoy#59 Resolves: pawamoy#59
@@ -223,6 +254,11 @@ class BasicConvention(CommitConvention): | |||
TYPES["remove"], | |||
] | |||
|
|||
@property |
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.
Given that the CommitConvention
classes utilize class attributes (rather than instance attributes), the process becomes slightly intricate. When updating self.TYPES, it's crucial for the regex to be updated as well. Consequently, we're presented with two options: either use a property or relocate it under __init__
. I'm not sure which choice is superior.
Issue: pawamoy#59 Resolves: pawamoy#59
Thanks for the PR 🙂
I understand this represent consequent work for this PR, but it's important we take the time to refactor when we have a chance to, otherwise this project will be less and less maintainable. I can definitely help with these refactors, if you're OK with me pushing to your branch 🙂 |
We can't run several conventions at the same time. Everytime you run the script it takes only one convention. Even if you want to “play”, you can be satisfied with commented block in pyproject.toml. I can't imagine any practice use, where commented blocks won't be enough.
English is not my native language, so sometimes I Could talk unclearly. When I say “You can overwrite default types with the It also means, that you free to add or remove any type. example: [tool.git-changelog.rewrite-convention]
bu = "Burger"
co = "Cola" Now you have only two types. With no feat etc. You have to specify sections |
Actually I move to the ConventionalBase only function definition. MINOR_TYPES values are still uniq and defined inside every convention. It is an example of refactoring, named “Extract Method“ - https://refactoring.guru/extract-method
Agree. That will be the best way, I think
sure, no problem. Thanks! |
Yes, that's why I mentioned the possible future "fallback" feature. But I'm probably overthinking. You are right that we should keep things simple. I'm not a fan of
That is what I understood yes. Specified types are not merged with default types. That's good. However, in the code I see: if rewrite_convention and not sections:
raise ValueError(...) This code does not try to verify if new types were added, or if types were removed. Maybe the user is fine with the default selected sections and their ordering, and just want to translate their titles. In that case, they wouldn't define |
chore: Prepare release 2.3.0
772b8e5
to
f9c91f1
Compare
Issue: #59
Resolves: #59