Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 1.05 KB

File metadata and controls

39 lines (25 loc) · 1.05 KB

Configurable Java Format

Coverity Scan Build Status

This is a fork of google-java-format with extended configurability. This project is not affiliated with Google.

Changes from the Original

  • Removed all plugins – this fork contains only the core formatter.
  • Added the --width option to specify a custom page width.
  • Supports setting options via environment variables.

Usage

# Help
java -jar configurable-java-format.jar --help

# Format
java -jar configurable-java-format.jar --width=120 File.java

# Format in place
java -jar configurable-java-format.jar --width=120 -i File.java

Alternatively, options can be passed as environment variables:

export JAVA_FORMAT_WIDTH=120
java -jar configurable-java-format.jar File.java

Acknowledgments

Thanks to MrDolch for his contributions.

License

This project is based on google-java-format and follows the same licensing terms.