Reduce RuboCop's CI time.
RuboCop extensions for lint only changed files in CI.
Git is required to work and assumes that the .git folder exists.
Add gem to your Gemfile
gem 'rubocop-changed'
Add to your .rubocop_for_ci.yml
(for use only on CI):
require: rubocop-changed
Or add argument:
rubocop --require rubocop-changed
The default branch for comparing gets by:
git remote show origin | sed -n '/HEAD branch/s/.*: //p' | xargs # usually it's main or master
For custom branch set env: RUBOCOP_CHANGED_BRANCH_NAME
The difference is the current extension didn't try to wrap RuboCop.
Instead, it just patched a small part of the code, which allows you to use $ rubocop
as before.
Bug reports and pull requests are welcome on GitHub at https://github.com/dukaev/rubocop-changed. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the Rubocop::Changed project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.