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-onlyoption useful for pre-commit hooks
Website: github.com/cortinico/ktfmt-gradle
Support:
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 | |
|---|---|
| ktlint | Kotlin linter with built-in formatter |
| Spotless | Keeps codebases pristine with automated formatting checks |
| ktfmt | Pretty-prints (formats) Kotlin code |
| ktlint-gradle | Runs ktlint from Gradle to enforce Kotlin style rules |
| Kotlinter Gradle | Plugin for linting and formatting |
| ktlint-gradle-plugin | Brings Kotlin linting and formatting checks into Gradle projects |
| ktfmt-gradle | Adds ktfmt formatting to Gradle builds with minimal fuss. |
| Kotlin Formatter | Formats Kotlin source with a simple, consistent command-line tool |
Read our verdict in the software roundup.
Explore our carefully curated directory of recommended free and open source software, covering every major software category.The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more. Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form. |


Please read our Comment Policy before commenting.