Rubocop: Fix Layout/IndentHeredoc issues (#1215)

This commit is contained in:
Susan Wright 2018-10-07 20:46:58 -06:00 committed by Daniel Colson
parent c22c9ab052
commit 2995978188
3 changed files with 10 additions and 33 deletions

View File

@ -15,23 +15,6 @@ AllCops:
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: auto_detection, squiggly, active_support, powerpack, unindent
Layout/IndentHeredoc:
Exclude:
- 'lib/factory_bot/linter.rb'
- 'spec/acceptance/lint_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForEmptyBraces.
# SupportedStyles: space, no_space, compact
# SupportedStylesForEmptyBraces: space, no_space
Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: space
# Offense count: 1
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/BlockLength:
@ -71,9 +54,3 @@ Style/MethodMissing:
# SupportedStyles: percent, brackets
Style/SymbolArray:
EnforcedStyle: brackets
# Offense count: 196
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Max: 189

View File

@ -86,10 +86,10 @@ module FactoryBot
exceptions.map(&:message)
end.flatten
<<-ERROR_MESSAGE.strip
The following factories are invalid:
<<~ERROR_MESSAGE.strip
The following factories are invalid:
#{lines.join("\n")}
#{lines.join("\n")}
ERROR_MESSAGE
end
end

View File

@ -14,11 +14,11 @@ describe "FactoryBot.lint" do
factory :always_valid
end
error_message = <<-ERROR_MESSAGE.strip
The following factories are invalid:
error_message = <<~ERROR_MESSAGE.strip
The following factories are invalid:
* user - Validation failed: Name can't be blank (ActiveRecord::RecordInvalid)
* admin_user - Validation failed: Name can't be blank (ActiveRecord::RecordInvalid)
* user - Validation failed: Name can't be blank (ActiveRecord::RecordInvalid)
* admin_user - Validation failed: Name can't be blank (ActiveRecord::RecordInvalid)
ERROR_MESSAGE
expect do
@ -105,10 +105,10 @@ The following factories are invalid:
end
end
error_message = <<-ERROR_MESSAGE.strip
The following factories are invalid:
error_message = <<~ERROR_MESSAGE.strip
The following factories are invalid:
* user+unnamed - Validation failed: Name can't be blank (ActiveRecord::RecordInvalid)
* user+unnamed - Validation failed: Name can't be blank (ActiveRecord::RecordInvalid)
ERROR_MESSAGE
expect do