Skip to content

A Danger Plugin to lint kotlin files using ktlint command line interface.

License

Notifications You must be signed in to change notification settings

nokite/danger-ktlint

 
 

Repository files navigation

danger-ktlint

Lint kotlin files only changed files in a pull request using ktlint command lint interface.

Installation

$ gem install danger-ktlint

Usage

You need to install ktlint command and set as executable first, see: https://ktlint.github.io/#getting-started.

# Example
$ curl --output /usr/local/bin/ktlint -sL https://github.com/pinterest/ktlint/releases/download/$KTLINT_VERSION/ktlint && chmod a+x /usr/local/bin/ktlint

Add this to Dangerfile.

ktlint.lint

# If you want inline comments, specify `ktlint.lint` with `inline_mode: true`
# ktlint.lint(inline_mode: true)

Options

Set maximum number of comments of ktlint results

Default is nil, all comments are sent.

ktlint.limit = 3
ktlint.lint

CHANGELOG

See CHANGELOG.md.

TODO

  • filtering: false (default: filtering: true behavior)

Development

  1. Clone this repo
  2. Run bundle install to setup dependencies.
  3. Run bundle exec rake spec to run the tests.
  4. Use bundle exec guard to automatically have tests run as you make changes.
  5. Make your changes.

About

A Danger Plugin to lint kotlin files using ktlint command line interface.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%