-
Notifications
You must be signed in to change notification settings - Fork 934
[FeatureReq] ability to fix warnings #584
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
Comments
Hi @Tbhesswebber! This does sound like a great idea. But this will imply a lot of changes too. So I think it's best to discuss this if and how we should approach this when @marionebl and @escapedcat have some time available. |
Just to understand this a bit better. You mean a rule could have a fix function as well. So for an easy rule, like "should have empty line before footer" the line could be added automatically? |
Precisely. Warning rules often have simple fixes - capitalization, new lines, etc. Rather than accepting warnings by default, it would be desirable to provide a prompt indicating the number of fixable errors and allow the user to fix all or cherrypick fixes. Fixing options could be opted out of - or overwritten - by users or inherited from standard configurations like |
Agreed, sounds kinda nice. Not sure if we have time for this though. You would you be able to give a hand with this? |
Note: This may exist and just not be documented/be documented somewhere that I didn't look.
--fix
flag to the cli orconfig.fix: true | "prompt" | "auto-accept"
in a config file.config.rules.<rule name>.fix = null | () => {}
Expected Behavior
1.1. Can prompt the user to accept the change. (Could possibly add in functionality to always show prompt regardless of warnings or errors)
fix
property inside of a custom rule sets the method for fixing said warning or error.Current Behavior
The current behavior seems to just accept commits with warnings without any fixing capabilities.
Affected packages
Possible Solution
Context
I just made a commit through commitizen that apparently didn't have an empty line before the footer, but commitlint accepted it with a warning.
The text was updated successfully, but these errors were encountered: