Address todos generated by rubocop for files starting with lib/factory_bot_rails (#296)
This partially addresses #293. Since rubocop generated quite a few todos, the commits addressing them are split up into a few different PRs that cover different files.
This commit is contained in:
parent
dc6c6012c4
commit
c6b66bbb1a
22
.rubocop.yml
22
.rubocop.yml
|
@ -5,6 +5,9 @@ AllCops:
|
||||||
Exclude:
|
Exclude:
|
||||||
- "tmp/**/*"
|
- "tmp/**/*"
|
||||||
|
|
||||||
|
Style/EmptyMethod:
|
||||||
|
EnforcedStyle: expanded
|
||||||
|
|
||||||
# TODO:
|
# TODO:
|
||||||
# This configuration was generated by
|
# This configuration was generated by
|
||||||
# `rubocop --auto-gen-config`
|
# `rubocop --auto-gen-config`
|
||||||
|
@ -86,24 +89,8 @@ Style/Documentation:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'spec/**/*'
|
- 'spec/**/*'
|
||||||
- 'test/**/*'
|
- 'test/**/*'
|
||||||
- 'lib/factory_bot_rails.rb'
|
|
||||||
- 'lib/factory_bot_rails/definition_file_paths.rb'
|
|
||||||
- 'lib/factory_bot_rails/generator.rb'
|
|
||||||
- 'lib/factory_bot_rails/generators/non_rspec_generator.rb'
|
|
||||||
- 'lib/factory_bot_rails/generators/null_generator.rb'
|
|
||||||
- 'lib/factory_bot_rails/generators/rspec_generator.rb'
|
|
||||||
- 'lib/factory_bot_rails/railtie.rb'
|
|
||||||
- 'lib/factory_bot_rails/reloader.rb'
|
|
||||||
- 'lib/generators/factory_bot/model/model_generator.rb'
|
- 'lib/generators/factory_bot/model/model_generator.rb'
|
||||||
|
|
||||||
# Offense count: 2
|
|
||||||
# Cop supports --auto-correct.
|
|
||||||
# Configuration parameters: EnforcedStyle.
|
|
||||||
# SupportedStyles: compact, expanded
|
|
||||||
Style/EmptyMethod:
|
|
||||||
Exclude:
|
|
||||||
- 'lib/factory_bot_rails/generators/null_generator.rb'
|
|
||||||
|
|
||||||
# Offense count: 29
|
# Offense count: 29
|
||||||
# Cop supports --auto-correct.
|
# Cop supports --auto-correct.
|
||||||
# Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
|
# Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
|
||||||
|
@ -143,9 +130,6 @@ Style/StringLiterals:
|
||||||
- 'factory_bot_rails.gemspec'
|
- 'factory_bot_rails.gemspec'
|
||||||
- 'features/step_definitions/rails_steps.rb'
|
- 'features/step_definitions/rails_steps.rb'
|
||||||
- 'features/support/env.rb'
|
- 'features/support/env.rb'
|
||||||
- 'lib/factory_bot_rails.rb'
|
|
||||||
- 'lib/factory_bot_rails/generator.rb'
|
|
||||||
- 'lib/factory_bot_rails/generators/rspec_generator.rb'
|
|
||||||
- 'lib/generators/factory_bot.rb'
|
- 'lib/generators/factory_bot.rb'
|
||||||
- 'lib/generators/factory_bot/model/model_generator.rb'
|
- 'lib/generators/factory_bot/model/model_generator.rb'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require 'factory_bot_rails/railtie'
|
require "factory_bot_rails/railtie"
|
||||||
|
|
||||||
module FactoryBotRails
|
module FactoryBotRails
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
require 'factory_bot_rails/generators/rspec_generator'
|
require "factory_bot_rails/generators/rspec_generator"
|
||||||
require 'factory_bot_rails/generators/non_rspec_generator'
|
require "factory_bot_rails/generators/non_rspec_generator"
|
||||||
require 'factory_bot_rails/generators/null_generator'
|
require "factory_bot_rails/generators/null_generator"
|
||||||
|
|
||||||
module FactoryBotRails
|
module FactoryBotRails
|
||||||
class Generator
|
class Generator
|
||||||
|
|
|
@ -16,7 +16,7 @@ module FactoryBotRails
|
||||||
end
|
end
|
||||||
|
|
||||||
def factory_bot_directory
|
def factory_bot_directory
|
||||||
@generators.options.fetch(:factory_bot, {}).fetch(:dir, 'spec/factories')
|
@generators.options.fetch(:factory_bot, {}).fetch(:dir, "spec/factories")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue