Search code examples
androidkotlinlintktlint

Difference Ktlint vs. lint?


According to this article, ktlint is an automatic linter with a built-in code style checker.

When I decide to use ktlint, what is the difference between lint and ktlint?

lint is optimized for Android

ktlint is optimized for Kotlin?

How is ktlint performing with integration systems like Bamboo? Will it apply autoamtically?


Solution

  • Linting is the process of checking the source code for Programmatic as well as Stylistic errors. Lint and Linting is more general and doesn't apply to Android only.

    Ktlint is more specific and checks rules more specific to Kotlin language.

    I personally use detekt for checking my code. It has more configuration options.

    How is ktlint performing with integration systems like Bamboo? Will it apply autoamtically?

    Linting doesn't depend on integration with other systems. It just checks any code you have.

    You can add pre-commit hook, to check your code with ktlint before commits:

    Video Tutorial and Explanation

    Tutorial 1

    Tutorial 2