I am really loving to code android apps in Kotlin recently - but I really miss lint. Anyone knows how to get this back ( at least partially ). Is there a project that adapts the android java lint rules to kotlin? AFAIK lint is not running on bytecode only so there needs to be some manual converting to be done. My main pain-point at the moment is that I need a compile-time error when I use a function < MINSDK level Can someone point me in the right direction?
Lint checks are automatically performed by the Gradle build system. To see the available checks in Android Studio File Settings Editor Inspections. You can also run the lint checks manually by right-clicking on your project and select Analyze Inspect Code. You can run link also from the command line.
If you develop in Kotlin, you can find useful to rely on some tools like a lint. If you don't know what it is, Wikipedia's definition for lint is: lint, or a linter, is a tool that analyzes source code to flag programming errors, bugs, stylistic errors, and suspicious constructs.
The lint tool checks your Android project source files for potential bugs and optimization improvements for correctness, security, performance, usability, accessibility, and internationalization. When using Android Studio, configured lint and IDE inspections run whenever you build your app.
What Is Linting? Linting is the automated checking of your source code for programmatic and stylistic errors. This is done by using a lint tool (otherwise known as linter). A lint tool is a basic static code analyzer. The term linting originally comes from a Unix utility for C.
The Kotlin team is working on supporting Android Lint checks for Kotlin code. You can watch this issue to keep track of the progress.
In the release of Android Studio 3.2, Lint can able to check.
Follow below step to enable lint check for Kotlin:
To enable these checks, go to File > Preferences > Editor > Inspections and check the rules that you want to enable under Kotlin Interoperability, as shown below.
You can then run the checks by selecting Analyze > Inspect Code from the main menu.
Check more info at Lint checks for Java/Kotlin interoperability
I hope it helps us.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With