ktlint
Our great sponsors
ktlint | kotlinx-kover | |
---|---|---|
7 | 4 | |
6,002 | 1,231 | |
1.1% | 4.7% | |
9.5 | 8.2 | |
3 days ago | 17 days ago | |
Kotlin | Kotlin | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
ktlint
-
Setting up linting/formatting for an Android project
In my experience, I have faced these issues while trying to keep the code style consistent across the team - 1. ktlint and "Reformat Code" in Android Studio produce different outputs. This causes issues as most developers find it easier to use "Reformat Code" in AS but if you have a ktlint check on CI, the checks sometimes fail. 2. Different AS versions produce different `codeStyles.xml` file. Sometimes, on updating AS, it automatically adds new rules to the `codeStyles.xml` file. These rules might not be compatible with ktlint and might only work on specific AS versions.
-
Modern Android Development in 2023
Ktlint
-
Three features in Android Studio that maybe you've missed
Not even an Android Studio-specific feature, but rather a feature of the underlying IntelliJ. Just select Code > Analyze code > Silent code cleanup and your entire project will be cleaned up using the default linter (this can be combined awesomely with Ktlint).
-
Ask HN: What is a modern Java environment?
Ktlint + Detekt: Kotlin linting/static analysis (https://ktlint.github.io, https://detekt.github.io/detekt)
-
Adding Klint to my Android apps
Refs. Klint Page Klint Github
-
Supercharge your Kotlin Project
Linting is the process of analyzing code for potential errors and one of the ways we can do that in Kotlin is using Ktlint. As per the documentation:
kotlinx-kover
-
Apache Maven JaCoCo Configuration
The tool to measure code coverage in Java is JaCoCo, but that is not the only one. There are existing things like OpenClover or in Kotlin things like Kover and so on (just to mention some).
-
Kover is a Gradle plugin for Kotlin code coverage tools (by Jetbrains IntelliJ). Does anyone try it? Is it ready for production in Android development?
Kover is still lacking basic Android support and in our Android projects we were not able to replace Jacoco yet (due to errors): https://github.com/Kotlin/kotlinx-kover/issues/18
-
Did anyone find a way to exclude compose previews from Jacoco code coverage?
Kover 0.6.1 now supports this: https://github.com/Kotlin/kotlinx-kover/issues/121
-
Ask HN: What is a modern Java environment?
- Language: Java 17 or Kotlin
- API Layer: For tiny projects, Vert.x API directly, for larger projects Quarkus
- DB: Postgres, in-memory H2 for simple stuff
- Testing: JUnit 5, Testcontainers to automatically start + stop DB Docker containers with tests, Mockito or Mockk (Kotlin) for mocks
- Dependency Injection: CDI (built into Quarkus, for Vert.x you can initalize Weld when the app starts)
- Build tool: Gradle with Kotlin DSL
- Other tools:
Kover: automatic code-coverage reports from JaCoCo/IntelliJ (https://github.com/Kotlin/kotlinx-kover)
What are some alternatives?
detekt - Static code analysis for Kotlin
kotlin - The Kotlin Programming Language.
sonarlint-intellij - SonarLint for IntelliJ
SDKMan - The SDKMAN! Command Line Interface
ktfmt-gradle - A Gradle plugin to apply ktfmt to your builds, and reformat you Kotlin source code like a glimpse 🧹🐘
example-jacoco - Example Project to setup JaCoCo
dokka - API documentation engine for Kotlin
Quarkus - Quarkus: Supersonic Subatomic Java.
ktlint-gradle - A ktlint gradle plugin
Micronaut - Micronaut Application Framework
CrunchyCalendar — awesome calendar widget for android apps - A beautiful material calendar with endless scroll, range selection and a lot more!
gwizard - A modular toolkit for building web services with Guice, inspired by DropWizard