Skip to content

Instantly share code, notes, and snippets.

@jessecurry
Created July 22, 2019 15:24
Show Gist options
  • Save jessecurry/6f918cd33f8148b2cf550a5b95e1044c to your computer and use it in GitHub Desktop.
Save jessecurry/6f918cd33f8148b2cf550a5b95e1044c to your computer and use it in GitHub Desktop.
Rubocop Setup
require:
- rubocop-rails
Rails:
Enabled: true
Metrics/ClassLength:
Enabled: false
Metrics/AbcSize:
Enabled: false
Metrics/LineLength:
Max: 120
Exclude:
- spec/**/*
Metrics/MethodLength:
Enabled: false
Style/Documentation:
Enabled: false
Metrics/BlockLength:
Exclude:
- spec/**/*
AllCops:
TargetRubyVersion: 2.6.2
Exclude:
- 'db/**/*'
- 'config/**/*'
- 'bin/*'
- 'lib/tasks/**/*'
- 'node_modules/**/*'
- Guardfile
- 'node_modules/**/*'
group :development, :test do
gem 'guard-rake'
gem 'guard-rspec', require: false
gem 'guard-rubocop'
gem 'rubocop-rails'
gem 'terminal-notifier'
gem 'terminal-notifier-guard'
end
# frozen_string_literal: true
group :red_green_refactor, halt_on_fail: true do
guard :rspec, cmd: "bundle exec rspec" do
# …
end
guard :rubocop, all_on_start: false do
watch(%r{.+\.rb$})
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
end
end
# Notification
notification :terminal_notifier, app_name: "AppName ::" if `uname` =~ /Darwin/
@jessecurry
Copy link
Author

Use bundle exec rubocop to check or bundle exec rubocop --safe-auto-correct to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment