https://github.com/ktlint/ktlint
An anti-bikeshedding Kotlin linter with built-in formatter
https://github.com/ktlint/ktlint
kotlin lint linter
Last synced: about 2 months ago
JSON representation
An anti-bikeshedding Kotlin linter with built-in formatter
- Host: GitHub
- URL: https://github.com/ktlint/ktlint
- Owner: ktlint
- License: mit
- Created: 2016-07-27T09:03:52.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2026-05-25T15:14:33.000Z (about 2 months ago)
- Last Synced: 2026-05-25T17:15:22.562Z (about 2 months ago)
- Topics: kotlin, lint, linter
- Language: Kotlin
- Homepage: https://ktlint.github.io/ktlint/
- Size: 87.6 MB
- Stars: 6,704
- Watchers: 50
- Forks: 525
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-ccamel - ktlint/ktlint - An anti-bikeshedding Kotlin linter with built-in formatter (Kotlin)
README
Kotlin linter in spirit of standard/standard (JavaScript) and gofmt (Go).
## Key features
- No configuration required
- Built-in Rule sets
- Built-in formatter
- `.editorconfig` support
- Several built-in reporters: `plain`, `json`, `html` and `checkstyle`
- Executable jar
- Allows extension with custom rule sets and reporters
## Quick start
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](https://ktlint.github.io/ktlint/latest/install/cli/#download-and-verification) or [other package managers](https://ktlint.github.io/ktlint/latest/install/cli/#package-managers) for alternative ways of installing ktlint. Or, use one of the [integrations like maven and gradle plugins](https://ktlint.github.io/ktlint/latest/install/integrations/).
* 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 title="Autocorrect style violations"
ktlint --format
# or
ktlint -F
```
See [cli usage](https://ktlint.github.io/ktlint/latest/install/cli/#command-line-usage) for a more extensive description on using ktlint.
## Documentation
### Legal
This project is no longer affiliated with Pinterest and is not affiliated with nor endorsed by JetBrains.
All code, unless specified otherwise, is licensed under the [MIT](https://opensource.org/licenses/MIT) license.
Copyright (c) 2019 Pinterest, Inc.
Copyright (c) 2016-2019 Stanley Shyiko.