Skip to content

pinterest/ktlint

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

The ExperimentalParams contains a mix of configuration settings which are not dependent on the file/code which is to be processed. Other parameters in that class describe the code/file to be processed but can be configured inconsistently (for example a file with name "foo.kt" could be marked as a Kotlin Script file).

The static object KtLint is deprecated and replaced by class KtLintRuleEngine which is configured with KtLintRuleEngineConfiguration. The instance of the KtLintRuleEngine is intended to be reused for scanning all files in a project and should not be recreated per file.

Both lint and format are simplified and can now be called for a code block or for an entire file.

Accompanying changes:
* Refactor exception handling during lint and format. Reduce length of stacktrace by propagating root cause only. Add filename to exception message.
* Print stacktrace in LintError.
* Replace abstract BaseCLITest class with CommandLineTestRunner
* Print log lines when ktlint is finished so that they can be used as fallback mechanism in unit tests to determine whether ktlint exited successfully or not. The normal exit value of the ktlint command is not always received by the system process that is running the command.
764135d

Git stats

Files

Permalink
Failed to load latest commit information.

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

Kotlin linter in spirit of feross/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

Documentation

User guide

Legal

This project is not affiliated with nor endorsed by JetBrains.
All code, unless specified otherwise, is licensed under the MIT license.
Copyright (c) 2019 Pinterest, Inc.
Copyright (c) 2016-2019 Stanley Shyiko.