google-java-format icon indicating copy to clipboard operation
google-java-format copied to clipboard

Java or Java-like files with alternate extensions are skipped.

Open DigiTec opened this issue 3 years ago • 0 comments

Main.java has a very simple path extension check.

    for (String fileName : parameters.files()) {
      if (!fileName.endsWith(".java")) {
        errWriter.println("Skipping non-Java file: " + fileName);
        continue;
      }

Is there any reason alternate file extensions can't be formatting/supported? You can somewhat get around this by using standard input formatting and --assume-filename, so you can get around this with some additional tooling, but the restriction on the extension seems to be more out of an abundance of caution for throwing mixed source directories and folder structures.

My original intention was to see how well GJF does on AIDL files which kicked of my investigation into my options.

DigiTec avatar Mar 20 '22 19:03 DigiTec