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

Pre-push hook does not run formatKotlin #232

Open
joshmsamuels opened this issue Dec 21, 2021 · 1 comment
Open

Pre-push hook does not run formatKotlin #232

joshmsamuels opened this issue Dec 21, 2021 · 1 comment

Comments

@joshmsamuels
Copy link

I tried running the pre-push hook with a simple change that should be auto-formatted by kotlinter. The change was to add an extra space after a line of code.

I ran the pre-push hook and the linter failed but my git status was not dirty so I added an echo in the script to make sure the status was being captured after lintKotlin and it was going down the code-path to format.

I do not see my echo and based on the output and my git status it looks like formatKotlin was not run.

My hypothesis is that lintKotlin exited with an error status code since there were linter violations, but the hook was not able to capture that failed status code and run the formatter before the script was terminated. Does this sound like a bug in the script?

@jeremymailen
Copy link
Owner

Thanks for the report. Can you let me know what flavor of shell you are using?
The syntax has been adjusted a couple of times, most recently here #177, to correctly capture the status, but it could be this doesn't work everywhere.

If you find that's the case, can you modify the shell script locally and see if it starts working with added [ ] or other shell changes?

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