Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/pinterest/ktlint

An anti-bikeshedding Kotlin linter with built-in formatter
https://github.com/pinterest/ktlint

kotlin lint linter

Last synced: about 1 month ago
JSON representation

An anti-bikeshedding Kotlin linter with built-in formatter

Lists

README

        






Join the chat at https://kotlinlang.slack.com
Build status
Maven Central
JitPack
HomeBrew
License
ktlint


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://pinterest.github.io/ktlint/latest/install/cli/#download-and-verification) or [other package managers](https://pinterest.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://pinterest.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://pinterest.github.io/ktlint/latest/install/cli/#command-line-usage) for a more extensive description on using ktlint.

## Documentation

User guide

### Legal

This project 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.