ktlint-gradle-plugin – Gradle plugin

ktlint-gradle-plugin is a Gradle plugin that runs ktlint checks and code formatting in Kotlin projects.

The plugin adds tasks to Gradle projects for checking and formatting Kotlin source code. It supports Kotlin JVM, Kotlin Multiplatform, Android, and Kotlin/JS projects, and works with both .kt and .kts files.

When a supported Kotlin Gradle plugin is used, ktlint-gradle-plugin adds tasks to format Kotlin code and report lint errors. The standard Gradle check task can depend on linting, helping teams enforce a consistent Kotlin code style as part of their build process.

This is free and open source software.

Key Features

  • Gradle wrapper for ktlint
  • Supports Kotlin JVM, Multiplatform, Android, and JS projects
  • Checks and formats .kt and .kts files
  • Adds formatKotlin and lintKotlin tasks
  • Granular tasks for each source set
  • Cacheable and incremental Gradle tasks
  • Uses the Gradle Worker API
  • Configurable reporters
  • Support for experimental ktlint rules
  • Option to disable selected rules
  • Baseline support for known lint violations
  • Support for custom ktlint RuleSets
  • Can ignore generated sources under the build directory
  • EditorConfig validation options

Website: github.com/cortinico/ktfmt-gradle
Support:
Developer: Nicola Corti
License: MIT License

ktlint-gradle-plugin is written in Kotlin. Learn Kotlin with our recommended free books and free tutorials.


Related Software

Kotlin Code Formatters
ktlintKotlin linter with built-in formatter
SpotlessKeeps codebases pristine with automated formatting checks
ktfmtPretty-prints (formats) Kotlin code
ktlint-gradleRuns ktlint from Gradle to enforce Kotlin style rules
Kotlinter GradlePlugin for linting and formatting
ktlint-gradle-pluginBrings Kotlin linting and formatting checks into Gradle projects
ktfmt-gradleAdds ktfmt formatting to Gradle builds with minimal fuss.
Kotlin FormatterFormats Kotlin source with a simple, consistent command-line tool

Read our verdict in the software roundup.


Best Free and Open Source Software Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.

This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more.

Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form.
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted