Safely autocorrect Layout/HashAlignment

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

Offenses:

app/controllers/spree/users_controller.rb:53:19: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
                  message: t('devise.user_registrations.spree_user.signed_up_but_unconfirmed') })
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/spree/users_controller.rb:53:101: C: Layout/LineLength: Line is too long. [107/100]
                            message: t('devise.user_registrations.spree_user.signed_up_but_unconfirmed') })
                                                                                                    ^^^^^^^
spec/models/enterprise_spec.rb:906:1: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
permissions: [permission])
^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/customers_spec.rb:19:1: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
code: nil, created_manually: true)
^^^^^^^^^
spec/system/admin/order_spec.rb:708:1: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
distributors: [distributor1])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/orders_spec.rb:45:4: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
   distributors: [distributor4, distributor5])
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/orders_spec.rb:249:9: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
        line_items_count: 0)
        ^^^^^^^^^^^^^^^^^^^
spec/system/admin/orders_spec.rb:254:9: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
        line_items_count: 1)
        ^^^^^^^^^^^^^^^^^^^
spec/system/admin/orders_spec.rb:259:9: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
        distributor: distributor2, bill_address_id: nil, ship_address_id: nil)
        ^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/orders_spec.rb:259:101: C: Layout/LineLength: Line is too long. [109/100]
                                       distributor: distributor2, bill_address_id: nil, ship_address_id: nil)
                                                                                                    ^^^^^^^^^
spec/system/admin/tag_rules_spec.rb:145:37: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
                                    count: 4
                                    ^^^^^^^^

1478 files inspected, 11 offenses detected, 9 offenses corrected
This commit is contained in:
Neal Chambers
2023-07-21 22:41:57 +09:00
parent 8bd25f9711
commit dce02160d4
7 changed files with 9 additions and 24 deletions

View File

@@ -6,21 +6,6 @@
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 9
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
# SupportedHashRocketStyles: key, separator, table
# SupportedColonStyles: key, separator, table
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
Layout/HashAlignment:
Exclude:
- 'app/controllers/spree/users_controller.rb'
- 'spec/models/enterprise_spec.rb'
- 'spec/system/admin/customers_spec.rb'
- 'spec/system/admin/order_spec.rb'
- 'spec/system/admin/orders_spec.rb'
- 'spec/system/admin/tag_rules_spec.rb'
# Offense count: 4
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.

View File

@@ -50,7 +50,7 @@ module Spree
"#signup-feedback",
partial("layouts/alert",
locals: { type: "success",
message: t('devise.user_registrations.spree_user.signed_up_but_unconfirmed') })
message: t('devise.user_registrations.spree_user.signed_up_but_unconfirmed') })
)
else
render status: :unprocessable_entity, cable_ready: cable_car.morph(

View File

@@ -903,7 +903,7 @@ describe Enterprise do
distributor = create(:distributor_enterprise, is_primary_producer: false)
permission = EnterpriseRelationshipPermission.create(name: "add_to_order_cycle")
create(:enterprise_relationship, parent: distributor, child: supplier,
permissions: [permission])
permissions: [permission])
product = create(:product)
order_cycle = create(
:simple_order_cycle,

View File

@@ -16,7 +16,7 @@ describe 'Customers' do
describe "using the customers index" do
let!(:customer1) {
create(:customer, first_name: 'John', last_name: 'Doe', enterprise: managed_distributor1,
code: nil, created_manually: true)
code: nil, created_manually: true)
}
let!(:customer2) {
create(:customer, enterprise: managed_distributor1, created_manually: true, code: nil)

View File

@@ -705,7 +705,7 @@ describe '
context "with different shipping methods" do
let!(:different_shipping_method_for_distributor1) do
create(:shipping_method_with, :flat_rate, name: "Different", amount: 15,
distributors: [distributor1])
distributors: [distributor1])
end
let!(:shipping_method_for_distributor2) do
create(:shipping_method, name: "Other", distributors: [distributor2])

View File

@@ -42,7 +42,7 @@ describe '
}
let!(:shipping_method2) {
create(:shipping_method_with, :pickup, name: "delivery",
distributors: [distributor4, distributor5])
distributors: [distributor4, distributor5])
}
let(:order_cycle) do
create(:simple_order_cycle, name: 'One', distributors: [distributor, distributor2,
@@ -246,17 +246,17 @@ describe '
context "cart orders" do
let!(:order_empty) {
create(:order_with_line_items, user: customer2, distributor: distributor2,
line_items_count: 0)
line_items_count: 0)
}
let!(:order_not_empty) {
create(:order_with_line_items, user: customer2, distributor: distributor2,
line_items_count: 1)
line_items_count: 1)
}
let!(:order_not_empty_no_address) {
create(:order_with_line_items, line_items_count: 1, user: customer2,
distributor: distributor2, bill_address_id: nil, ship_address_id: nil)
distributor: distributor2, bill_address_id: nil, ship_address_id: nil)
}
before do

View File

@@ -142,7 +142,7 @@ describe 'Tag Rules' do
it "saves changes to rules of each type" do
# Tag groups exist
expect(page).to have_selector '.customer_tag .header', text: "For customers tagged:",
count: 4
count: 4
expect(page).to have_selector '.customer_tag .header tags-input .tag-list ti-tag-item',
text: "member", count: 1
expect(page).to have_selector '.customer_tag .header tags-input .tag-list ti-tag-item',