Back to Ktlint

or

documentation/release-latest/docs/quick-start.md

1.8.0773 B
Original Source

Follow steps below for a quick start with latest ktlint release.

Step 1: Install with brew

shell
brew install ktlint

See download and verification from GitHub or other package managers for alternative ways of installing ktlint. Or, use one of the integrations like maven and gradle plugins.

Step 2: Lint and format your code

All files with extension .kt and .kts in the current directory and below will be scanned. Problems will be fixed automatically when possible.

shell
ktlint --format
# or
ktlint -F

See cli usage for a more extensive description on using ktlint.