Difference Ktlint vs. lint?
Asked Answered
G

1

7

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?

Grunter answered 7/8, 2020 at 11:52 Comment(0)
O
13

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

Opposition answered 7/8, 2020 at 13:2 Comment(2)
Ok, I remeber in earlier projects we had github configured that way, it did not accept unformatted code. How can I achieve this?Grunter
@PavelPipovic I've updated my answer with detailed instructions for checks before pushing code to GIT. Follow Video tutorial, it is easy.Opposition

© 2022 - 2024 — McMap. All rights reserved.