google / google/google-java-format

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

Open
#769 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
6.2k
Forks
937
Avg merge
6m
Merged PRs (30d)
3

Description

Main.java has a very simple path extension check.

```java
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.