Skip to content

Commit

Permalink
Address todos generated by rubocop for files in Rakefile and Appraisa…
Browse files Browse the repository at this point in the history
…ls. (#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.
  • Loading branch information
petestreet authored and composerinteralia committed Sep 28, 2018
1 parent c6b66bb commit 77d707d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 35 deletions.
11 changes: 0 additions & 11 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ Lint/AmbiguousRegexpLiteral:
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
Lint/UnusedBlockArgument:
Exclude:
- 'Rakefile'
- 'features/support/env.rb'

# Offense count: 2
Expand Down Expand Up @@ -97,7 +96,6 @@ Style/Documentation:
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
Style/HashSyntax:
Exclude:
- 'Rakefile'
- 'gemfiles/rails4.2.gemfile'
- 'gemfiles/rails5.0.gemfile'
- 'gemfiles/rails5.1.gemfile'
Expand All @@ -124,9 +122,7 @@ Style/PercentLiteralDelimiters:
Style/StringLiterals:
EnforcedStyle: "double_quotes"
Exclude:
- 'Appraisals'
- 'Gemfile'
- 'Rakefile'
- 'factory_bot_rails.gemspec'
- 'features/step_definitions/rails_steps.rb'
- 'features/support/env.rb'
Expand Down Expand Up @@ -169,10 +165,3 @@ Style/WordArray:
# URISchemes: http, https
Metrics/LineLength:
Max: 133

# Offense count: 1
# Cop supports --auto-correct.
Performance/RegexpMatch:
Exclude:
- 'Rakefile'

22 changes: 11 additions & 11 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# These are the versions of Rails we want to test against.
appraise 'rails4.2' do
gem 'rails', '~> 4.2.0'
appraise "rails4.2" do
gem "rails", "~> 4.2.0"
end

appraise 'rails5.0' do
gem 'activerecord', '~> 5.0.0'
gem 'railties', '~> 5.0.0'
appraise "rails5.0" do
gem "activerecord", "~> 5.0.0"
gem "railties", "~> 5.0.0"
end

appraise 'rails5.1' do
gem 'activerecord', '~> 5.1.0'
gem 'railties', '~> 5.1.0'
appraise "rails5.1" do
gem "activerecord", "~> 5.1.0"
gem "railties", "~> 5.1.0"
end

appraise 'rails5.2' do
gem 'activerecord', '~> 5.2.0'
gem 'railties', '~> 5.2.0'
appraise "rails5.2" do
gem "activerecord", "~> 5.2.0"
gem "railties", "~> 5.2.0"
end
26 changes: 13 additions & 13 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
require 'bundler/setup'
require 'cucumber/rake/task'
require 'rspec/core/rake_task'
require "bundler/setup"
require "cucumber/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|
t.fork = true
t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress')]
t.cucumber_opts = ["--format", (ENV["CUCUMBER_FORMAT"] || "progress")]
end

RSpec::Core::RakeTask.new(:spec)

require 'appraisal'
require "appraisal"

desc 'Run the test suite'
task :default do |t|
if ENV['BUNDLE_GEMFILE'] =~ /gemfiles/
exec 'rake spec && rake cucumber'
desc "Run the test suite"
task :default do
if ENV["BUNDLE_GEMFILE"] =~ /gemfiles/
exec "rake spec && rake cucumber"
else
Rake::Task['appraise'].execute
Rake::Task["appraise"].execute
end
end

task :appraise => ['appraisal:install'] do |t|
exec 'rake appraisal'
task appraise: ["appraisal:install"] do
exec "rake appraisal"
end

0 comments on commit 77d707d

Please sign in to comment.