Created
July 22, 2019 15:24
-
-
Save jessecurry/6f918cd33f8148b2cf550a5b95e1044c to your computer and use it in GitHub Desktop.
Rubocop Setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/**/*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use
bundle exec rubocop
to check orbundle exec rubocop --safe-auto-correct
to fix.