macisamuele / language-formatters-pre-commit-hooks

Collection of custom pre-commit hooks.
Apache License 2.0
112 stars 56 forks source link

Support native google-java-format executables #215

Open vorburger opened 4 months ago

vorburger commented 4 months ago

In https://github.com/google/google-java-format/issues/868#issuecomment-1951339602 (via https://github.com/google/google-java-format/pull/1045, et al), we have made "native" (non java -jar google-java-format*.jar) binaries available; the first release to include that was https://github.com/google/google-java-format/releases/tag/v1.20.0.

E.g. https://github.com/JoseVSeb/google-java-format-for-vs-code/issues/17 adopted this in a VSC extension.

This can make checks a) run a bit faster, and b) avoiding requiring having a java on the PATH, which makes this hook easier to run in certain cases (example).

Would you consider adding support for this in this project?

macisamuele commented 4 months ago

I would be considering the option of not running the tool via java -jar prelude for versions of the tool that suport that. We do need to make sure that this would work across OSes as well.

I'm open to contributors helping to improve the project. Feel free to open a PR for it and I'll be prioritising reviewing and releasing it.