Skip to content
file-text

GitHub Action

ktlint-pr-comments

v1.2 Latest version

ktlint-pr-comments

file-text

ktlint-pr-comments

Run Ktlint in all added/modified .kt files and make comments for any errors

Installation

Copy and paste the following snippet into your .yml file.

              

- name: ktlint-pr-comments

uses: le0nidas/[email protected]

Learn more about this action in le0nidas/ktlint-pr-comments

Choose a version

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