```ruby
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
```

Use overcommit to run rake lint checks
user
```ruby
append_to_file "Rakefile" do
  <<~RUBY

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

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