Add rubocop spacing rules

We were following these rules in most places; we just didn't define them
anywhere.
This commit is contained in:
Javi Martín
2019-06-22 18:11:23 +02:00
parent c7f64f8493
commit f9ed186909
264 changed files with 652 additions and 577 deletions

View File

@@ -1,5 +1,7 @@
--- ---
linters: linters:
ExtraNewline:
enabled: true
FinalNewline: FinalNewline:
enabled: true enabled: true
SelfClosingTag: SelfClosingTag:
@@ -16,5 +18,27 @@ linters:
enabled: true enabled: true
only: only:
- Layout/EndOfLine - Layout/EndOfLine
- Layout/SpaceAfterColon
- Layout/SpaceAfterComma
- Layout/SpaceAfterMethodName
- Layout/SpaceAfterNot
- Layout/SpaceAfterSemicolon
- Layout/SpaceAroundBlockParameters
- Layout/SpaceAroundOperators
- Layout/SpaceBeforeBlockBraces
- Layout/SpaceBeforeComma
- Layout/SpaceBeforeComment
- Layout/SpaceBeforeFirstArg
- Layout/SpaceBeforeSemicolon
- Layout/SpaceInsideArrayLiteralBrackets
- Layout/SpaceInsideArrayPercentLiteral
- Layout/SpaceInsideBlockBraces
- Layout/SpaceInsideHashLiteralBraces
- Layout/SpaceInsideParens
- Layout/SpaceInsidePercentLiteralDelimiters
- Layout/SpaceInsideRangeLiteral
- Layout/SpaceInsideReferenceBrackets
- Layout/SpaceInsideStringInterpolation
- Layout/Tab
- Lint/LiteralAsCondition - Lint/LiteralAsCondition
- Style/PercentLiteralDelimiters - Style/PercentLiteralDelimiters

View File

@@ -32,6 +32,73 @@ Layout/EmptyLines:
Layout/EndOfLine: Layout/EndOfLine:
EnforcedStyle: lf EnforcedStyle: lf
Layout/SpaceAfterColon:
Enabled: true
Layout/SpaceAfterComma:
Enabled: true
Layout/SpaceAfterMethodName:
Enabled: true
Layout/SpaceAfterNot:
Enabled: true
Layout/SpaceAfterSemicolon:
Enabled: true
Layout/SpaceAroundBlockParameters:
Enabled: true
Layout/SpaceAroundOperators:
Enabled: true
Layout/SpaceBeforeBlockBraces:
Enabled: true
Layout/SpaceBeforeComma:
Enabled: true
Layout/SpaceBeforeComment:
Enabled: true
Layout/SpaceBeforeFirstArg:
Enabled: true
Layout/SpaceBeforeSemicolon:
Enabled: true
Layout/SpaceInsideArrayLiteralBrackets:
Enabled: true
Layout/SpaceInsideArrayPercentLiteral:
Enabled: true
Layout/SpaceInsideBlockBraces:
Enabled: true
Layout/SpaceInsideHashLiteralBraces:
Enabled: true
EnforcedStyle: compact
Layout/SpaceInsideParens:
Enabled: true
Layout/SpaceInsidePercentLiteralDelimiters:
Enabled: true
Layout/SpaceInsideRangeLiteral:
Enabled: true
Layout/SpaceInsideReferenceBrackets:
Enabled: true
Layout/SpaceInsideStringInterpolation:
Enabled: true
Layout/Tab:
Enabled: true
Layout/TrailingBlankLines: Layout/TrailingBlankLines:
Enabled: true Enabled: true

View File

@@ -1,6 +1,4 @@
shared_examples "documentable" do |documentable_factory_name, shared_examples "documentable" do |documentable_factory_name, documentable_path, documentable_path_arguments|
documentable_path,
documentable_path_arguments|
include ActionView::Helpers include ActionView::Helpers
let(:administrator) { create(:user) } let(:administrator) { create(:user) }

View File

@@ -1,6 +1,4 @@
shared_examples "imageable destroy" do |imageable_factory_name, shared_examples "imageable destroy" do |imageable_factory_name, imageable_path, imageable_path_arguments|
imageable_path,
imageable_path_arguments|
include ActionView::Helpers include ActionView::Helpers
include ImagesHelper include ImagesHelper
include ImageablesHelper include ImageablesHelper

View File

@@ -1,10 +1,4 @@
shared_examples "mappable" do |mappable_factory_name, shared_examples "mappable" do |mappable_factory_name, mappable_association_name, mappable_new_path, mappable_edit_path, mappable_show_path, mappable_path_arguments, management = false|
mappable_association_name,
mappable_new_path,
mappable_edit_path,
mappable_show_path,
mappable_path_arguments,
management = false|
include ActionView::Helpers include ActionView::Helpers

View File

@@ -1,7 +1,4 @@
shared_examples "nested documentable" do |login_as_name, documentable_factory_name, shared_examples "nested documentable" do |login_as_name, documentable_factory_name, path, documentable_path_arguments, fill_resource_method_name, submit_button, documentable_success_notice|
path, documentable_path_arguments,
fill_resource_method_name, submit_button,
documentable_success_notice|
include ActionView::Helpers include ActionView::Helpers
include DocumentsHelper include DocumentsHelper
include DocumentablesHelper include DocumentablesHelper

View File

@@ -1,7 +1,4 @@
shared_examples "nested imageable" do |imageable_factory_name, path, shared_examples "nested imageable" do |imageable_factory_name, path, imageable_path_arguments, fill_resource_method_name, submit_button, imageable_success_notice, has_many_images = false|
imageable_path_arguments, fill_resource_method_name,
submit_button, imageable_success_notice,
has_many_images = false|
include ActionView::Helpers include ActionView::Helpers
include ImagesHelper include ImagesHelper
include ImageablesHelper include ImageablesHelper