google / google/google-java-format

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

Aberta
#769 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Java
Estrelas
6.2k
Forks
937
Merge médio
6min
PRs com merge (30d)
3

Descrição

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.

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

Start in Main.java at the path-extension check shown in the issue, and review how standard input with --assume-filename currently handles alternate names. Determine the supported behavior for Java-like extensions, then add coverage for the chosen cases and confirm that ordinary non-Java files are still skipped.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
java
Domínio
tooling
Tipo de issue
Funcionalidade
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
45/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.