summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2016-05-21 18:27:15 -0500
committerRobert Speicher <rspeicher@gmail.com>2016-05-23 15:59:32 -0400
commit43d9e06b68d82588ca582f43971cae040b04674f (patch)
treec432108778a9a6dd15198f25e2558a1e3b368d8c
parentc002a560afae7db6a5c778bc78028243c2fc945a (diff)
downloadgitlab-ce-rs-rubocop-rspec.tar.gz
Add rubocop-rspecrs-rubocop-rspec
Almost all cops are starting as disabled until we can fix their violations.
-rw-r--r--.rubocop.yml50
-rw-r--r--Gemfile1
-rw-r--r--Gemfile.lock3
-rw-r--r--lib/tasks/rubocop.rake1
4 files changed, 55 insertions, 0 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index 03e026ccee9..ca5afde75b1 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 790c457e1dc..e854a31b425 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 52aee37d737..4533aa31d5f 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 ddfaf5d51f2..78ffccc9d06 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