Skip to content

Github Action for running ktlint (https://ktlint.github.io/) in all .kt files that were changed in a PR.

License

Notifications You must be signed in to change notification settings

le0nidas/ktlint-pr-comments

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Ktlint PR comments v1.2

This action runs ktlint against all .kt files that were changed in a PR and makes a line comment for every error that ktlint found.

Note that in order to make a comment the error must be in a line that is part of the PR's diff.

Usage

- uses: le0nidas/[email protected]
  with:
    repotoken: ${{ secrets.GITHUB_TOKEN }}
    arguments: "--disabled_rules=parameter-list-wrapping,final-newline"

Example

The code:

class Person(val name: String, val age: Int) {
}

will produce the comment:

screenshot