Our great sponsors
-
ktfmt
A program that reformats Kotlin source code to comply with the common community standard for Kotlin code conventions.
-
gradle-dependencies-sorter
A CLI app and Gradle plugin to sort the dependencies in your Gradle build scripts
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
The script below will run ktfmt over a Kotlin codebase and fail the push if any of the files are not well-formatted. It does also use a custom Gradle plugin we built around ktfmt, which accepts a --run-over change set. This script will leave the fixed formatting changes in the tree, awaiting the developer to intervene, commit, and try again.
The script below can be trivially adapted to any other number of tools, and you can include a few such scripts in your ./scripts/pre-push.d. For example, my current codebase has one for ktfmt, and a very similar one for Square's Gradle Dependencies Sorter.
Related posts
- react-native-awesome-template: A React Native starter template to have a better product and development experience
- Kotlin Routing - routing everything
- Arrow Project for Arrow on GitHub
- Show HN: Soil – Compose-First Power Packs for Kotlin Multiplatform and Android
- Show HN: Android SDK that supports OpenTelemetry export