-
Notifications
You must be signed in to change notification settings - Fork 80
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
Feature: IDEA: trigger ktfmt check on attempted commit #255
Comments
You can write a git precommit hook to just run ktfmt before you can even commit locally. You could probably copy it fromt this ktlin gradle plugin repo: https://github.com/JLLeitschuh/ktlint-gradle#additional-helper-tasks |
If you use |
If you are using the IDEA plugin it will reformat the code of all changed files if you have the checkbox selected. |
For pre-commit users, I've recently added support for ktfmt in the See the MR: macisamuele/language-formatters-pre-commit-hooks#196 Here's a sample
Thanks @macisamuele for helping setting it up. |
Closing as this is a solved issue |
It would be cool if ktfmt executed a check when a user attempts to commit to VCS (maybe as a warning).
Or even better, runs the formatter itself when you attempt to commit.
I have countless times committed my code to then fail on CI because I forget to run ktfmt.
The text was updated successfully, but these errors were encountered: