diff --git a/.rubocop.yml b/.rubocop.yml index 03e026ccee96f6e1fa61bfabcc39e5cd9216cfde..ca5afde75b1ecc273ccf3f896ad63e1642fdb5c8 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,5 @@ +require: rubocop-rspec + AllCops: TargetRubyVersion: 2.1 # Cop names are not displayed in offense messages by default. Change behavior @@ -1071,3 +1073,51 @@ Rails/TimeZone: # Use validates :attribute, hash of validations. Rails/Validation: Enabled: false + +##################### RSpec ################################## + +RSpec/AnyInstance: + Enabled: false + +RSpec/DescribeClass: + Enabled: false + +RSpec/DescribeMethod: + Enabled: false + +RSpec/DescribedClass: + Enabled: false + +RSpec/ExampleLength: + Enabled: false + Max: 5 + +RSpec/ExampleWording: + Enabled: false + CustomTransform: + be: is + have: has + not: does not + IgnoredWords: [] + +RSpec/FilePath: + Enabled: false + CustomTransform: + RuboCop: rubocop + RSpec: rspec + +RSpec/Focus: + Enabled: true + +RSpec/InstanceVariable: + Enabled: false + +RSpec/MultipleDescribes: + Enabled: false + +RSpec/NotToNot: + EnforcedStyle: not_to + Enabled: false + +RSpec/VerifiedDoubles: + Enabled: false diff --git a/Gemfile b/Gemfile index 790c457e1dc872d7bdd71e79b13bb598a0738da0..e854a31b425dca34b579ebb62a5865d2a914bb20 100644 --- a/Gemfile +++ b/Gemfile @@ -294,6 +294,7 @@ group :development, :test do gem 'spring-commands-teaspoon', '~> 0.0.2' gem 'rubocop', '~> 0.40.0', require: false + gem 'rubocop-rspec', '~> 1.5.0', require: false gem 'scss_lint', '~> 0.47.0', require: false gem 'coveralls', '~> 0.8.2', require: false gem 'simplecov', '~> 0.11.0', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 52aee37d737bc8bd20fdb46467fecaff5e4cf4e0..4533aa31d5f5fcf98ec7118c2981f35489243ec9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -692,6 +692,8 @@ GEM rainbow (>= 1.99.1, < 3.0) ruby-progressbar (~> 1.7) unicode-display_width (~> 1.0, >= 1.0.1) + rubocop-rspec (1.5.0) + rubocop (>= 0.40.0) ruby-fogbugz (0.2.1) crack (~> 0.4) ruby-progressbar (1.8.1) @@ -1016,6 +1018,7 @@ DEPENDENCIES rspec-rails (~> 3.4.0) rspec-retry rubocop (~> 0.40.0) + rubocop-rspec (~> 1.5.0) ruby-fogbugz (~> 0.2.1) sanitize (~> 2.0) sass-rails (~> 5.0.0) diff --git a/lib/tasks/rubocop.rake b/lib/tasks/rubocop.rake index ddfaf5d51f281225a717c4fe8ef4e8ce4dc1a0e7..78ffccc9d0658678c6eddc3f5dd60c3c43543219 100644 --- a/lib/tasks/rubocop.rake +++ b/lib/tasks/rubocop.rake @@ -1,4 +1,5 @@ unless Rails.env.production? require 'rubocop/rake_task' + RuboCop::RakeTask.new end