Skip to content

Conversation

casper-la-cour-sg
Copy link
Contributor

No description provided.

cushon and others added 24 commits December 8, 2022 07:29
This allows building the Java > 11 logic in google-java-format into the jar
regardless of what language level is configured for the entire build, and
then dynamically enabling it when running on a new enough JDK, while
remaining compatible with earlier JDK versions.

PiperOrigin-RevId: 490074589
So that its `@Nullable` annotation is treated as a type-use annotation and formatted accordingly. See jspecify/jspecify#260.

Fixes #869

COPYBARA_INTEGRATE_REVIEW=google/google-java-format#869 from PicnicSupermarket:improvement/support-new-jpecify-package-name 7a0dc20b5cddc4d560b2be25441b1ab26c3229c2
PiperOrigin-RevId: 495701635
This brings us in line with the Unix standard of returning non-zero for a failed command:
https://www.gnu.org/software/bash/manual/html_node/Exit-Status.html

Also, this will allow any callers (like google-java-format-diff.py) to respond appropriately.
[A change](http://r.android.com/2257232) needed to be reverted because `google-java-format-diff.py`
was failing silently, so the author wasn't aware that their change caused a pre-upload hook to stop working.

Fixes #848

COPYBARA_INTEGRATE_REVIEW=google/google-java-format#848 from abstractlyZach:return_nonzero 06b2d3671d77c406be9b6d982321b17b920826df
PiperOrigin-RevId: 502399096
I've signed the CLA.

Fixes #847

COPYBARA_INTEGRATE_REVIEW=google/google-java-format#847 from stiemannkj1:fix-846-mem-thread-leak 0ca1e9bf9c8cf877509ac39cc50707d0ade7d71c
PiperOrigin-RevId: 507026969
See investigation in b/269345183

PiperOrigin-RevId: 509647966
This is currently the only non-whitespace change made as part of the core
formatting logic. This is a requirement for updating the IntelliJ plugin to
use the new supported plugin API.

PiperOrigin-RevId: 512153706
I'm going to add tests next, but with this weird file structure I've been using, there's no good place to put them.

The only content changes here are in build.gradle.

PiperOrigin-RevId: 512914783
Also support optimizing imports, using the ImportOptimizer API.

PiperOrigin-RevId: 513562756
Pop up this warning once per-project per-launch, only when the Formatter is enabled (or at startup if the formatter is already enabled in the project).

PiperOrigin-RevId: 513822794
I moved the description out of the Gradle config and into the XML. (It was just in the gradle so we could add the gjf version number, but that seems unnecessary since I changed the versioning so that the plugin version matches the gjf version.)

I also updated the IntelliJ Gradle plugin to 1.13.1 because plugin publishing is broken in 1.13.0.

PiperOrigin-RevId: 513888985
I don't really understand _why_ this works. I'm able to (easily) reproduce the
problem by not including the `=` in my `idea64.options` file. But then if I
copy/paste the command line out of `ps`, it works fine.

And since it's easy enough to change this, I'm inclined to just do that?

Fixes #908.

PiperOrigin-RevId: 514440074
Previously, blank lines could only be emitted before comments if they were there in the input. This was irrespective of BlankLineWanted.YES hints in the OpBuilder.

These hints are already being set by some paths in GJF, so now that they're respected, blank lines will be added to some existing files.

Eval in unknown commit

PiperOrigin-RevId: 514817708
PiperOrigin-RevId: 515682100
… use gjf.

Right now if your IDE isn't set up properly and you have gjf enabled in a
project, you get a single warning. Any uses of the code formatter after that
will instead use the built-in formatter.

This is confusing to people who don't notice the notification. They think gjf
is formatting their code strangely. Instead, let's warn on every single
invocation of the formatter until they either fix the configuration issue or
disable gjf in the project.

Fixes #914 #919.

PiperOrigin-RevId: 515722447
I have a feeling this is causing a lot of the issues people are seeing where
it's constantly trying to reformat and failing because of syntax errors.
Hopefully this will make it only try to reformat when a user specifically
requests it.

PiperOrigin-RevId: 521657519
@casper-la-cour-sg casper-la-cour-sg merged commit fbeef75 into master Apr 19, 2023
@casper-la-cour-sg casper-la-cour-sg deleted the rebase-google-v1-16-0 branch April 19, 2023 07:57
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

Successfully merging this pull request may close these issues.

9 participants