javafmt

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2023 License: BSD-3-Clause Imports: 10 Imported by: 0

README

javafmt

For both Java and Kotlin, organize imports and then format the code with google-java-format or ktlint, depending on the file extension.

Requirements

  • google-java-format
  • ktlint

Example use

cd my-java-project
javafmt

Or to change the files (-w for "write"):

cd my-java-project
javafmt -w

Or to format all .kt and .java in a directory, but not touch the imports:

cd my-java-project
javafm -n -w

Quick installation

Requires Go 1.21 or later:

go install github.com/xyproto/javafmt@latest

Issues

This utility is a bit experimental, so the correct imports may not always be used. Bug reports and pull requests are welcome!

General info

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL