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

When specifying the version 1.10.0 in the hook args, pretty-format-java hook is not working #58

Closed
siddeshbb opened this issue May 13, 2021 · 6 comments · Fixed by #59
Closed

Comments

@siddeshbb
Copy link

I know the latest version of google-java-format 1.10.0 is used in this hook.

But when we explicitly specify the version as args in pretty-format-java hook its failing to download.

  - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
    rev: v2.0.0
    hooks:
      - id: pretty-format-java
        args: [--autofix,--google-java-formatter-version=1.10.0]

Terminal Output:

RuntimeError: Failed to download https://github.com/google/google-java-format/releases/download/google-java-format-1.10.0/google-java-format-1.10.0-all-deps.jar. Probably the requested version, 1.10.0, is not valid or you have some network issue.

I see you are using the below url format in the code
https://github.com/google/google-java-format/releases/download/google-java-format-{version}/google-java-format-{version}-all-deps.jar

But from google java release of 1.10.0 has this below url
https://github.com/google/google-java-format/releases/download/v1.10.0/google-java-format-1.10.0-all-deps.jar

@macisamuele
Copy link
Owner

That's sad ;( ... the release link has been changed.
Up to version 1.9 the link-template was correct.

Going to fix it right away

@siddeshbb
Copy link
Author

siddeshbb commented May 17, 2021

Thank you @macisamuele.
Just a quick question, currently the pretty-format-java hook is using the version 1.10.0 or 1.9 ?

@macisamuele
Copy link
Owner

it might be possible that is using 1.10 but not entirely sure

@stefanDeveloper
Copy link

Currently, I also face problems with JDK 16 and the version 1.9. However, with version 1.10.0 it has been fixed, see google/google-java-format#538. Therefore, I support this fix too

@macisamuele
Copy link
Owner

I'll be dedicating today some time to actually make #59 mergable and release a new version.
Sorry for the inconvenience but I got a very intense stream of days ;P

@macisamuele
Copy link
Owner

Version 2.1.0 has just been released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants