Skip to content

KOTLIN

Linters

Linter Additional
ktlint
KOTLIN_KTLINT
GitHub stars autofix sarif
detekt
KOTLIN_DETEKT
GitHub stars

Linted files

  • File extensions:
    • .kt
    • .kts

Configuration in MegaLinter

Variable Description Default value
KOTLIN_PRE_COMMANDS List of bash commands to run before the linters None
KOTLIN_POST_COMMANDS List of bash commands to run after the linters None
KOTLIN_FILTER_REGEX_INCLUDE Custom regex including filter
KOTLIN_FILTER_REGEX_EXCLUDE Custom regex excluding filter

Behind the scenes

Installation

  • Dockerfile commands :
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk
ENV PATH="$JAVA_HOME/bin:${PATH}"