Skip to content

Add ktlint with auto-formatted codebase#366

Open
holodorum wants to merge 2 commits intokson-org:mainfrom
holodorum:ktlinter
Open

Add ktlint with auto-formatted codebase#366
holodorum wants to merge 2 commits intokson-org:mainfrom
holodorum:ktlinter

Conversation

@holodorum
Copy link
Copy Markdown
Collaborator

Add the org.jlleitschuh.gradle.ktlint plugin (v14.2.0) to the root project and all Kotlin subprojects. check now depends on ktlintCheck, and ./gradlew ktlintFormat is available for auto-fixing.

This commit also contains the formats made by running ./gradlew ktlintFormat and some manual fixes to get ./gradlew ktlintCheck to pass.

I currently used the almost all the default rules of ktlint (see the .editorconfig), if we want to disable any of the defaults we can change it there.

Apply org.jlleitschuh.gradle.ktlint (v14.2.0) to the root project
and to Kotlin subprojects (via pluginManager.withPlugin so that
non-Kotlin subprojects like lib-python and lib-rust are unaffected).

The plugin's ktlintCheck task is automatically wired as a dependency
of `check`.  `./gradlew ktlintFormat` is available to auto-fix
violations.
Fixed all linting errors. Most could get resolved
by simply running `./gradlew ktlinterFormat`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant