Coding

ktfmt-gradle – Gradle plugin that applies the ktfmt formatter to Kotlin projects

ktfmt-gradle is a Gradle plugin that applies ktfmt formatting to Kotlin projects.

ktfmt is an opinionated code formatter for Kotlin. ktfmt-gradle integrates the formatter into Gradle builds so developers can check whether Kotlin source code follows the configured style, or automatically reformat code as part of their normal development workflow.

The plugin is useful for Kotlin projects that want reproducible formatting checks in local builds and continuous integration systems. It supports JVM, Android, JavaScript, and Kotlin Multiplatform projects, and can also format top-level Kotlin script files.

This is free and open source software.

Key Features

  • Applies ktfmt formatting from Gradle builds
  • Adds tasks to check and format Kotlin source code
  • Supports JVM, Android, JavaScript, and Kotlin Multiplatform projects
  • Creates source-set specific formatting tasks
  • Can format top-level Kotlin script files
  • Supports Google style and Kotlin language style formatting
  • Offers incremental build support
  • Parallel file processing using Kotlin Coroutines
  • Configurable with a ktfmt {} Gradle block
  • Provides an --include-only option useful for pre-commit hooks

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

ktfmt-gradle 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
ktfmtPretty-prints (formats) Kotlin code
Kotlinter GradlePlugin for linting and formatting

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