Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disambiguating multiple formatted files when writing to standard output #994

Open
aaronsky opened this issue Nov 29, 2023 · 0 comments
Open

Comments

@aaronsky
Copy link

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:

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:

/* 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant