Safely autocorrect Layout/FirstHashElementIndentation

Inspecting 1478 files
...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C..................................................................................................................................................................................

Offenses:

spec/services/products_renderer_spec.rb:73:11: C: [Corrected] Layout/FirstHashElementIndentation: Use 2 spaces for indentation in a hash, relative to the first position after the preceding left parenthesis.
          "#{[:name, :meta_keywords, :variants_display_as, ...
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/services/products_renderer_spec.rb:76:9: C: [Corrected] Layout/FirstHashElementIndentation: Indent the right brace the same as the first position after the preceding left parenthesis.
        } })
        ^

1478 files inspected, 2 offenses detected, 2 offenses corrected
This commit is contained in:
David Cook
2023-07-20 14:05:16 +10:00
parent aa124511de
commit 19ee2b50c2
2 changed files with 4 additions and 12 deletions

View File

@@ -16,14 +16,6 @@ Gemspec/RequiredRubyVersion:
- 'engines/order_management/order_management.gemspec'
- 'engines/web/web.gemspec'
# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: special_inside_parentheses, consistent, align_braces
Layout/FirstHashElementIndentation:
Exclude:
- 'spec/services/products_renderer_spec.rb'
# Offense count: 9
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.

View File

@@ -70,10 +70,10 @@ describe ProductsRenderer do
it "filters products by name_or_meta_keywords_or_variants_display_as_or_" \
"variants_display_name_or_supplier_name_cont" do
products_renderer = ProductsRenderer.new(distributor, order_cycle, customer, { q: {
"#{[:name, :meta_keywords, :variants_display_as,
:variants_display_name, :supplier_name]
.join('_or_')}_cont": "apples",
} })
"#{[:name, :meta_keywords, :variants_display_as,
:variants_display_name, :supplier_name]
.join('_or_')}_cont": "apples",
} })
products = products_renderer.send(:products)
expect(products).to eq([product_apples])
end