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

Recursively Formatting

Open d-pizhuk opened this issue 1 year ago • 1 comments

Is it possible to format files in a folder recursively? I tried: java -jar google-java-format-1.19.2-all-deps.jar -replace "folder/extra/*", but it formats only files within this folder and does not format files in inner folders.

d-pizhuk avatar Jan 26 '24 06:01 d-pizhuk

There isn't built-in functionality for walking a folder to find files to format. On unix you could consider something like:

find folder/extra/ -type f -name '*.java' | xargs google-java-format -i

cushon avatar Feb 06 '24 03:02 cushon