1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot.git synced 2022-11-09 11:43:51 -05:00

Update Rubocop to support new thoughtbot defaults

One annoyance is that the thoughtbot defaults include the Rails
cops, which don't quite make sense here. I am forced into loading the
rubocop-rails gem but then disabling all of the cops in it.
This commit is contained in:
Daniel Colson 2020-01-17 14:40:13 -05:00
parent cef7ec75b8
commit 6d8bea1670
No known key found for this signature in database
GPG key ID: 88A364BBE77B1353
4 changed files with 21 additions and 12 deletions

View file

@ -9,6 +9,9 @@ AllCops:
- 'gemfiles/*'
- 'tmp/**/*'
Rails:
Enabled: false
Metrics/BlockLength:
CountComments: true
Max: 25

View file

@ -76,6 +76,7 @@ GEM
parallel (1.19.1)
parser (2.7.0.2)
ast (~> 2.4.0)
rack (2.1.1)
rainbow (3.0.0)
rake (12.3.2)
rspec (3.8.0)
@ -94,15 +95,18 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.2)
rubocop (0.68.0)
rubocop (0.79.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.5, != 2.5.1.1)
parser (>= 2.7.0.1)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.6)
rubocop-performance (1.3.0)
rubocop (>= 0.68.0)
unicode-display_width (>= 1.4.0, < 1.7)
rubocop-performance (1.5.2)
rubocop (>= 0.71.0)
rubocop-rails (2.4.1)
rack (>= 1.1)
rubocop (>= 0.72.0)
ruby-progressbar (1.10.1)
simplecov (0.16.1)
docile (~> 1.1)
@ -115,7 +119,7 @@ GEM
thread_safe (0.3.6-java)
tzinfo (1.2.5)
thread_safe (~> 0.1)
unicode-display_width (1.5.0)
unicode-display_width (1.6.1)
yard (0.9.20)
PLATFORMS
@ -132,8 +136,9 @@ DEPENDENCIES
rake
rspec
rspec-its
rubocop (= 0.68)
rubocop
rubocop-performance
rubocop-rails
simplecov
sqlite3
yard

View file

@ -31,8 +31,9 @@ Gem::Specification.new do |s|
s.add_development_dependency("rake")
s.add_development_dependency("rspec")
s.add_development_dependency("rspec-its")
s.add_development_dependency("rubocop", "0.68")
s.add_development_dependency("rubocop")
s.add_development_dependency("rubocop-performance")
s.add_development_dependency("rubocop-rails")
s.add_development_dependency("simplecov")
s.add_development_dependency("yard")

View file

@ -2,11 +2,11 @@ module FactoryBot
# @api private
module Internal
DEFAULT_STRATEGIES = {
build: FactoryBot::Strategy::Build,
create: FactoryBot::Strategy::Create,
build: FactoryBot::Strategy::Build,
create: FactoryBot::Strategy::Create,
attributes_for: FactoryBot::Strategy::AttributesFor,
build_stubbed: FactoryBot::Strategy::Stub,
null: FactoryBot::Strategy::Null,
build_stubbed: FactoryBot::Strategy::Stub,
null: FactoryBot::Strategy::Null,
}.freeze
DEFAULT_CALLBACKS = [