0

In my Android Studio app project, I've integrated ktlint gradle.

Is it possible to configure the ktlint gradle plugin, so that it runs continuously on the fly (while coding on the keyboard)?? Like ESlint is used for JS, it warns me immediately if any lint warnings occur..

2 Answers 2

0

It is not possible to do that. klint is not a static analysis tool.

Alternatively, you can write custom lint rules for the same. Here are some resources for doing so:

  1. Android Dev summit 2018 talk
  2. Android Dev summit 2019 talk
  3. Android source code for standard lint rules
  4. Repos
    1. https://github.com/googlesamples/android-custom-lint-rules
    2. https://github.com/tikurahul/lint-experiments
    3. https://github.com/vanniktech/lint-rules
0

This is possible in Intellij / Android Studio if you install the ktlint IDEA plugin.

It's also configurable so you can represent findings as warnings or errors.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.