-
Notifications
You must be signed in to change notification settings - Fork 15
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
Switch code style to Google's Java Code Style #661
base: main
Are you sure you want to change the base?
Conversation
9799dc4
to
d6a0e59
Compare
Mabye spotless ? https://github.com/diffplug/spotless |
Wait for another PR - I have success with palantir-java-format. That is a) more maintained and b) seems to work well and c) has better formatting than GJF: (1) google-java-format output: private static void configureResolvedVersionsWithVersionMapping(Project project) {
project.getPluginManager()
.withPlugin(
"maven-publish",
plugin -> {
project.getExtensions()
.getByType(PublishingExtension.class)
.getPublications()
.withType(MavenPublication.class)
.configureEach(
publication ->
publication.versionMapping(
mapping -> {
mapping.allVariants(
VariantVersionMappingStrategy
::fromResolutionResult);
}));
});
} (1) palantir-java-format output: private static void configureResolvedVersionsWithVersionMapping(Project project) {
project.getPluginManager().withPlugin("maven-publish", plugin -> {
project.getExtensions()
.getByType(PublishingExtension.class)
.getPublications()
.withType(MavenPublication.class)
.configureEach(publication -> publication.versionMapping(mapping -> {
mapping.allVariants(VariantVersionMappingStrategy::fromResolutionResult);
}));
});
}
|
New try at #663 |
# Conflicts: # .github/workflows/tests.yml
I applied the binary from https://github.com/google/google-java-format/releases/tag/v1.24.0 MINGW64 /c/git-repositories/jabref (add-gjf)
$ find . -name "*.java" -exec /c/Users/koppor/Downloads/google-java-format_windows-x86-64.exe -r -a --skip-reflowing-long-strings --skip-javadoc-formatting "{}" \; |
OMG - the windows binary of GJF behaves differently to the JAR -- google/google-java-format#1171 |
I am so fed up that
Thus, I am looking for good autoformatting tools. The most prominent tool with style guide is Google's:
This PR adds it.
Let's hope for the best that the reformatting action a) really adds a new commit and b) the contributors will be able to pull these changes 😅🙈
I am aware, that there is no maintained gradle plugin.
I am also aware, that there is no AOSP support for Eclipse since 5 years (google/google-java-format#251), but maybe, this will be resolved.
One needs to run it twice for coments: google/google-java-format#211
Blockers
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)