Liam Miller-Cushon

Results 183 comments of Liam Miller-Cushon

My understanding is that glibc is generally backwards compatible, so building against older versions and running against newer versions will work. So using a slightly older ubuntu image would be...

I have made a release that includes the change to use an older ubuntu image: https://github.com/google/google-java-format/releases/tag/v1.21.0 @vorburger can you check if that fixes the issue you were seeing?

I agree this is not ideal. I think the specific change in `1.19.2` was 38de9c4e05bc871496c232c1ccbfc4be06a580e2, prior to that code inside `\{ ... }` wasn't getting reformatted at all. I think...

@vorburger the `illegal escape character` error is because you're running the formatting on JDK 17, which predates string template support. Using JDK 21 instead will resolve that error.

The style guide requires braces for `if` statements: https://google.github.io/styleguide/javaguide.html#s4.1.1-braces-always-used (#938 is slightly related) So I agree this isn't a good formatting and we'd probably prefer something like the following, but...

Can you say more about what the desired workflow would be? Would you like to be able to `bazel run //some/target` and have that format the files? Or a test...

If you want a `main`-like interface, I'd look at using the `GoogleJavaFormatToolProvider`. There's a unit test for it with a usage example.

Note that you don't need to instantiate the class directory, you can also use the ToolProvider SPI: https://github.com/google/google-java-format/blob/1a0065696b4f408313dbd24f9d6606d758e98868/core/src/test/java/com/google/googlejavaformat/java/GoogleJavaFormatToolProviderTest.java#L42 For the Bazel part, tests can only see files if they're inputs...

There isn't built-in functionality for walking a folder to find files to format. On unix you could consider something like: ``` find folder/extra/ -type f -name '*.java' | xargs google-java-format...

The note on the [cglib homepage](https://github.com/cglib/cglib) says "cglib is unmaintained and does not work well (or possibly at all?) in newer JDKs, particularly JDK17+". cglib depends on ASM, which is...