Lint kotlin files only changed files in a pull request using ktlint command lint interface.
$ gem install danger-ktlint
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)
Default is nil
, all comments are sent.
ktlint.limit = 3
ktlint.lint
See CHANGELOG.md.
- filtering: false (default: filtering: true behavior)
- Clone this repo
- Run
bundle install
to setup dependencies. - Run
bundle exec rake spec
to run the tests. - Use
bundle exec guard
to automatically have tests run as you make changes. - Make your changes.