1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot_rails.git synced 2022-11-09 11:49:18 -05:00

Address todos generated by rubocop for files in Rakefile and Appraisals. (#298)

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:
Alex 2018-09-28 13:10:19 -05:00 committed by Daniel Colson
parent c6b66bbb1a
commit 77d707d2c7
3 changed files with 24 additions and 35 deletions

View file

@ -64,7 +64,6 @@ Lint/AmbiguousRegexpLiteral:
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
Lint/UnusedBlockArgument: Lint/UnusedBlockArgument:
Exclude: Exclude:
- 'Rakefile'
- 'features/support/env.rb' - 'features/support/env.rb'
# Offense count: 2 # Offense count: 2
@ -97,7 +96,6 @@ Style/Documentation:
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
Style/HashSyntax: Style/HashSyntax:
Exclude: Exclude:
- 'Rakefile'
- 'gemfiles/rails4.2.gemfile' - 'gemfiles/rails4.2.gemfile'
- 'gemfiles/rails5.0.gemfile' - 'gemfiles/rails5.0.gemfile'
- 'gemfiles/rails5.1.gemfile' - 'gemfiles/rails5.1.gemfile'
@ -124,9 +122,7 @@ Style/PercentLiteralDelimiters:
Style/StringLiterals: Style/StringLiterals:
EnforcedStyle: "double_quotes" EnforcedStyle: "double_quotes"
Exclude: Exclude:
- 'Appraisals'
- 'Gemfile' - 'Gemfile'
- 'Rakefile'
- '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'
@ -169,10 +165,3 @@ Style/WordArray:
# URISchemes: http, https # URISchemes: http, https
Metrics/LineLength: Metrics/LineLength:
Max: 133 Max: 133
# Offense count: 1
# Cop supports --auto-correct.
Performance/RegexpMatch:
Exclude:
- 'Rakefile'

View file

@ -1,19 +1,19 @@
# These are the versions of Rails we want to test against. # These are the versions of Rails we want to test against.
appraise 'rails4.2' do appraise "rails4.2" do
gem 'rails', '~> 4.2.0' gem "rails", "~> 4.2.0"
end end
appraise 'rails5.0' do appraise "rails5.0" do
gem 'activerecord', '~> 5.0.0' gem "activerecord", "~> 5.0.0"
gem 'railties', '~> 5.0.0' gem "railties", "~> 5.0.0"
end end
appraise 'rails5.1' do appraise "rails5.1" do
gem 'activerecord', '~> 5.1.0' gem "activerecord", "~> 5.1.0"
gem 'railties', '~> 5.1.0' gem "railties", "~> 5.1.0"
end end
appraise 'rails5.2' do appraise "rails5.2" do
gem 'activerecord', '~> 5.2.0' gem "activerecord", "~> 5.2.0"
gem 'railties', '~> 5.2.0' gem "railties", "~> 5.2.0"
end end

View file

@ -1,27 +1,27 @@
require 'bundler/setup' require "bundler/setup"
require 'cucumber/rake/task' require "cucumber/rake/task"
require 'rspec/core/rake_task' require "rspec/core/rake_task"
Bundler::GemHelper.install_tasks name: 'factory_bot_rails' Bundler::GemHelper.install_tasks name: "factory_bot_rails"
Cucumber::Rake::Task.new(:cucumber) do |t| Cucumber::Rake::Task.new(:cucumber) do |t|
t.fork = true t.fork = true
t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress')] t.cucumber_opts = ["--format", (ENV["CUCUMBER_FORMAT"] || "progress")]
end end
RSpec::Core::RakeTask.new(:spec) RSpec::Core::RakeTask.new(:spec)
require 'appraisal' require "appraisal"
desc 'Run the test suite' desc "Run the test suite"
task :default do |t| task :default do
if ENV['BUNDLE_GEMFILE'] =~ /gemfiles/ if ENV["BUNDLE_GEMFILE"] =~ /gemfiles/
exec 'rake spec && rake cucumber' exec "rake spec && rake cucumber"
else else
Rake::Task['appraise'].execute Rake::Task["appraise"].execute
end end
end end
task :appraise => ['appraisal:install'] do |t| task appraise: ["appraisal:install"] do
exec 'rake appraisal' exec "rake appraisal"
end end