Skip to content

Commit e8174aa

Browse files
Enable Layout/ArgumentAlignment cop
1 parent 8b5b957 commit e8174aa

File tree

7 files changed

+23
-20
lines changed

7 files changed

+23
-20
lines changed

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ Lint/ParenthesesAsGroupedExpression:
3939
Layout/AccessModifierIndentation:
4040
Enabled: true
4141

42+
Layout/ArgumentAlignment:
43+
Enabled: true
44+
4245
Layout/CaseIndentation:
4346
Enabled: true
4447

lib/active_admin/batch_actions/resource_extension.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ def add_default_batch_action
6969

7070
redirect_to active_admin_config.route_collection_path(params),
7171
notice: I18n.t("active_admin.batch_actions.succesfully_destroyed",
72-
count: selected_ids.count,
73-
model: active_admin_config.resource_label.downcase,
74-
plural_model: active_admin_config.plural_resource_label(count: selected_ids.count).downcase)
72+
count: selected_ids.count,
73+
model: active_admin_config.resource_label.downcase,
74+
plural_model: active_admin_config.plural_resource_label(count: selected_ids.count).downcase)
7575
end
7676
end
7777

lib/active_admin/views/footer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def footer_text
2121

2222
def powered_by_message
2323
I18n.t("active_admin.powered_by",
24-
active_admin: link_to("Active Admin", "https://activeadmin.info"),
25-
version: ActiveAdmin::VERSION).html_safe
24+
active_admin: link_to("Active Admin", "https://activeadmin.info"),
25+
version: ActiveAdmin::VERSION).html_safe
2626
end
2727

2828
end

lib/generators/active_admin/webpacker/webpacker_generator.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ def install_assets
1212
copy_file "#{__dir__}/plugins/jquery.js", Rails.root.join("config/webpack/plugins/jquery.js").to_s
1313

1414
insert_into_file Rails.root.join("config/webpack/environment.js").to_s,
15-
"const jquery = require('./plugins/jquery')\n",
16-
after: /require\(('|")@rails\/webpacker\1\);?\n/
15+
"const jquery = require('./plugins/jquery')\n",
16+
after: /require\(('|")@rails\/webpacker\1\);?\n/
1717

1818
insert_into_file Rails.root.join("config/webpack/environment.js").to_s,
19-
"environment.plugins.prepend('jquery', jquery)\n",
20-
before: "module.exports"
19+
"environment.plugins.prepend('jquery', jquery)\n",
20+
before: "module.exports"
2121

2222
run "yarn add @activeadmin/activeadmin"
2323
end

lib/ransack_ext.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
end
1212

1313
config.add_predicate "gteq_datetime",
14-
arel_predicate: "gteq",
15-
formatter: ->(v) { v.beginning_of_day }
14+
arel_predicate: "gteq",
15+
formatter: ->(v) { v.beginning_of_day }
1616

1717
config.add_predicate "lteq_datetime",
18-
arel_predicate: "lt",
19-
formatter: ->(v) { v + 1.day }
18+
arel_predicate: "lt",
19+
formatter: ->(v) { v + 1.day }
2020
end

spec/support/templates_with_data/admin/posts.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
f.input :title
110110
f.input :author
111111
f.input :published_date,
112-
hint: f.object.persisted? && "Created at #{f.object.created_at}"
112+
hint: f.object.persisted? && "Created at #{f.object.created_at}"
113113
f.input :custom_category_id
114114
f.input :category
115115
f.input :position

spec/unit/dependency_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,17 @@
5858
describe "`!`" do
5959
it "raises an error if requirement not met" do
6060
expect { k.foo! "5" }.to raise_error ActiveAdmin::DependencyError,
61-
"You provided foo 1.2.3 but we need: 5."
61+
"You provided foo 1.2.3 but we need: 5."
6262
end
6363

6464
it "accepts multiple arguments" do
6565
expect { k.foo! "> 1", "< 1.2" }.to raise_error ActiveAdmin::DependencyError,
66-
"You provided foo 1.2.3 but we need: > 1, < 1.2."
66+
"You provided foo 1.2.3 but we need: > 1, < 1.2."
6767
end
6868

6969
it "raises an error if not provided" do
7070
expect { k.bar! }.to raise_error ActiveAdmin::DependencyError,
71-
"To use bar you need to specify it in your Gemfile."
71+
"To use bar you need to specify it in your Gemfile."
7272
end
7373
end
7474
end
@@ -98,10 +98,10 @@
9898
expect(k["a-b"].match! "1.2.3").to eq nil
9999

100100
expect { k["a-b"].match! "2.5" }.to raise_error ActiveAdmin::DependencyError,
101-
"You provided a-b 1.2.3 but we need: 2.5."
101+
"You provided a-b 1.2.3 but we need: 2.5."
102102

103103
expect { k["b-c"].match! }.to raise_error ActiveAdmin::DependencyError,
104-
"To use b-c you need to specify it in your Gemfile."
104+
"To use b-c you need to specify it in your Gemfile."
105105
end
106106

107107
# Note: Ruby comparison operators are separate from the `foo? '> 1'` syntax
@@ -137,7 +137,7 @@
137137

138138
it "throws a custom error if the gem is missing" do
139139
expect { k["b-c"] < 23 }.to raise_error ActiveAdmin::DependencyError,
140-
"To use b-c you need to specify it in your Gemfile."
140+
"To use b-c you need to specify it in your Gemfile."
141141
end
142142
end
143143
end

0 commit comments

Comments
 (0)