append_to_file "Rakefile" do
  <<~RUBY

  begin
    require "rubocop/rake_task"
    RuboCop::RakeTask.new
    task default: %w[test test:system rubocop]
  rescue LoadError # rubocop:disable Lint/HandleExceptions
  end
  RUBY
end

append_to_file "Rakefile" do
  <<~RUBY

  task :overcommit do
    sh "bundle exec overcommit --run"
  end

  task default: %w[test test:system overcommit]
  RUBY
end

Use overcommit to run rake lint checks
Use overcommit to run rake lint checks
