google / google/google-java-format
Disambiguating multiple formatted files when writing to standard output
- Linguagem predominante
- Java
- Estrelas
- 6.2k
- Forks
- 937
- Merge médio
- 6min
- PRs com merge (30d)
- 3
Descrição
When using google-java-format to format multiple files and print their formatted results to standard-out, it's unclear how I'm supposed to disambiguate between the results in the output. For performance reasons, I am running google-java-format against my codebase in batches of 100 files at a time, and for various other reasons, formatting in-place is not preferred.
For example, running this:
```shell
java -jar $HOME/bin/google-java-format --aosp path/to/file1.java path/to/file2.java path/to/file3.java path/to/file4.java
```
results in output like this:
```shell
/* my file 1 */
public class File1 {
// ...
}
/* my file 2 */
public class File2 {
// ...
}
/* my file 3 */
public class File3 {
// ...
}
/* my file 4 */
public class File4 {
// ...
}
```
This example is kind of contrived, but the main point is that the end of file1.java and the start of file2.java, and so on, are not delimited in a clear way. What can I do here to clearly associate the output for each formatted file with its source path?
Guia de contribuição
Direção de pesquisa
Comece com a invocação da CLI google-java-format mostrada na issue, concentrando-se na formatação de vários arquivos enviada para a saída padrão. Determine uma forma clara de associar cada resultado formatado ao seu caminho de origem e, em seguida, verifique o comportamento com o exemplo de quatro arquivos e uma entrada em lote equivalente.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- java
- Domínio
- cli
- Tipo de issue
- Funcionalidade
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 38/100