-
Notifications
You must be signed in to change notification settings - Fork 58
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
Add support for Palantir Java Formatter #213
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks good and thanks for updating the automation to automatically update the tool versions.
If tests are green I'll be happy to merge and release this change
Base branch was modified
Palantir Java formatter currently requires Java Version < 21 and is not available if java version is above 21, so coverage won't show 100% if it's the case. |
If this is the case we need to make sure that
Once the points above are verified tests will be green and we could merge this |
I think I have this test, I'll double check it. |
Anyway this won't help with coverage that you'd like to be 100% |
Do you mind if I'll split tests for |
I would rather prefer to keep the tests of a single module into a single test file, it makes it managing them more predictable. Test coverage can be kept high, it is sufficient to check what the test is mentioning as not covered lines
Checking the code I see that the following line is not covered language-formatters-pre-commit-hooks/language_formatters_pre_commit_hooks/pretty_format_java.py Line 220 in 881f4e1
The coverage missing is due to the fact that we cannot guarantee that end-to-end test is run with Java 21 in all the environments, hence let's add PS: I would suggest to rebase the branch on the latest |
@macisamuele I've done as you said.
For java pre 21, coverage is 100%, while on java 21 palantir coverage won't pass because of test precondition. |
@macisamuele any news? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #213 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 355 371 +16
=========================================
+ Hits 355 371 +16 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks overall good.
@macisamuele you can't guarantee full coverage on Java 21, as tool doesn't support Java 21 at all, as it just don't run because of internal dependencies and slow development process (due to licensing). I can comment all lines for Palantir code as |
Hello there, Palantir support would be great, is there any news on the subject? |
[Palantir Java Formatter](https://github.com/palantir/palantir-java-format) has a bit different settings than Google Java Format.
* Rename version file from palantir_java_format.version to palantir.version * Update palantir to 2.43.0 * Add test for Java 21
Palantir doesn't run on Java >=21
@macisamuele Palantir fixed the issue and now supports Java 21. I updated version, rebased and added tests. Could you please review it again? |
6f10286
to
c9adebb
Compare
def get_urls(_version: str) -> typing.List[str]: | ||
# Links extracted from https://github.com/jsonschema2dataclass/palantir-cli | ||
return [ | ||
"https://github.com/jsonschema2dataclass/palantir-cli/releases/download/" | ||
"{version}/palantir-cli-{version}-standalone.jar".format( | ||
version=_version, | ||
), | ||
] | ||
|
||
possible_urls = get_urls(version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is copied from other parts of the code but IMO I would inline this function
Please address coverage and then ready to merge.
|
@macisamuele Finally nailed it! |
Any news? |
Had a very busy time in the last days. |
Change is merged , at the same time pre-commit were not really fixed. |
Thank you! |
Palantir Java Formatter has a bit different settings than Google Java Format.
As the original project doesn't provide standalone version, repackager CI has been used.