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

Format files in a pre-commit and add them to the commit. #790

Open
ezamelczyk opened this issue Dec 18, 2024 · 0 comments
Open

Format files in a pre-commit and add them to the commit. #790

ezamelczyk opened this issue Dec 18, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@ezamelczyk
Copy link

What would you like to be able to do?

I am using ktfmt to keep consistent formatting in my kotlin project. I'd like to be able to create a hook that will automatically run the ktfmtFormat task and commit the formatted files. As of right now calling the ktfmtFormat properly formats the files but doing it in a pre-commit hook does not change anything. Basically I'm asking is it possible to have this configuration work:

gitHooks {
    preCommit {
        tasks("ktfmtFormat")
    }
    createHooks(true)
}

If you have any ideas on how this should be implemented, please tell us here.

I'm not sure how

Is this a feature you are interested in implementing yourself?

Maybe

@ezamelczyk ezamelczyk added the enhancement New feature or request label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant