Add and apply MultilineMethodCallBraceLayout rule
In order for this rule to work effectively when running `--autocorrect`, we also need to enable the `ClosingParenthesisIndentation` rule.
This commit is contained in:
@@ -30,6 +30,9 @@ Layout/AssignmentIndentation:
|
||||
Layout/ClosingHeredocIndentation:
|
||||
Enabled: true
|
||||
|
||||
Layout/ClosingParenthesisIndentation:
|
||||
Enabled: true
|
||||
|
||||
Layout/DotPosition:
|
||||
Enabled: true
|
||||
|
||||
@@ -108,6 +111,9 @@ Layout/MultilineHashBraceLayout:
|
||||
Layout/MultilineHashKeyLineBreaks:
|
||||
Enabled: true
|
||||
|
||||
Layout/MultilineMethodCallBraceLayout:
|
||||
Enabled: true
|
||||
|
||||
Layout/MultilineMethodCallIndentation:
|
||||
Enabled: true
|
||||
|
||||
|
||||
@@ -97,8 +97,7 @@
|
||||
title: t("form.accept_terms_title"),
|
||||
label: t("form.accept_terms",
|
||||
policy: link_to(t("form.policy"), "/privacy", target: "blank"),
|
||||
conditions: link_to(t("form.conditions"), "/conditions", target: "blank")
|
||||
) %>
|
||||
conditions: link_to(t("form.conditions"), "/conditions", target: "blank")) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -25,7 +25,8 @@
|
||||
<p>
|
||||
<%= sanitize(ballot.change_vote_info(
|
||||
link: link_to(t("budgets.investments.index.sidebar.change_vote_link"),
|
||||
budget_ballot_path(budget)))) %>
|
||||
budget_ballot_path(budget))
|
||||
)) %>
|
||||
</p>
|
||||
|
||||
<ul class="ballot-list">
|
||||
|
||||
@@ -45,8 +45,7 @@
|
||||
title: t("form.accept_terms_title"),
|
||||
label: t("form.accept_terms",
|
||||
policy: link_to(t("form.policy"), "/privacy", target: "blank"),
|
||||
conditions: link_to(t("form.conditions"), "/conditions", target: "blank")
|
||||
) %>
|
||||
conditions: link_to(t("form.conditions"), "/conditions", target: "blank")) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -104,8 +104,7 @@
|
||||
title: t("form.accept_terms_title"),
|
||||
label: t("form.accept_terms",
|
||||
policy: link_to(t("form.policy"), "/privacy", target: "blank"),
|
||||
conditions: link_to(t("form.conditions"), "/conditions", target: "blank")
|
||||
) %>
|
||||
conditions: link_to(t("form.conditions"), "/conditions", target: "blank")) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -29,7 +29,8 @@ class Admin::BudgetsController < Admin::BaseController
|
||||
@budget.headings.each { |heading| Budget::Result.new(@budget, heading).delay.calculate_winners }
|
||||
redirect_to admin_budget_budget_investments_path(
|
||||
budget_id: @budget.id,
|
||||
advanced_filters: ["winners"]),
|
||||
advanced_filters: ["winners"]
|
||||
),
|
||||
notice: I18n.t("admin.budgets.winners.calculated")
|
||||
end
|
||||
|
||||
|
||||
@@ -148,7 +148,8 @@ class Comment < ApplicationRecord
|
||||
def validate_body_length
|
||||
validator = ActiveModel::Validations::LengthValidator.new(
|
||||
attributes: :body,
|
||||
maximum: Comment.body_max_length)
|
||||
maximum: Comment.body_max_length
|
||||
)
|
||||
validator.validate(self)
|
||||
end
|
||||
|
||||
|
||||
@@ -52,14 +52,16 @@ class Organization < ApplicationRecord
|
||||
def validate_name_length
|
||||
validator = ActiveModel::Validations::LengthValidator.new(
|
||||
attributes: :name,
|
||||
maximum: Organization.name_max_length)
|
||||
maximum: Organization.name_max_length
|
||||
)
|
||||
validator.validate(self)
|
||||
end
|
||||
|
||||
def validate_responsible_name_length
|
||||
validator = ActiveModel::Validations::LengthValidator.new(
|
||||
attributes: :responsible_name,
|
||||
maximum: Organization.responsible_name_max_length)
|
||||
maximum: Organization.responsible_name_max_length
|
||||
)
|
||||
validator.validate(self)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -427,7 +427,8 @@ class User < ApplicationRecord
|
||||
def validate_username_length
|
||||
validator = ActiveModel::Validations::LengthValidator.new(
|
||||
attributes: :username,
|
||||
maximum: User.username_max_length)
|
||||
maximum: User.username_max_length
|
||||
)
|
||||
validator.validate(self)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -35,8 +35,7 @@
|
||||
firefox: link_to(t("layouts.application.firefox"),
|
||||
"https://www.mozilla.org/firefox",
|
||||
title: t("shared.target_blank"),
|
||||
target: "_blank")
|
||||
)) %>
|
||||
target: "_blank"))) %>
|
||||
</p>
|
||||
</div>
|
||||
<![endif]-->
|
||||
|
||||
@@ -66,8 +66,7 @@
|
||||
title: t("form.accept_terms_title"),
|
||||
label: t("form.accept_terms",
|
||||
policy: link_to(t("form.policy"), "/privacy", target: "blank"),
|
||||
conditions: link_to(t("form.conditions"), "/conditions", target: "blank")
|
||||
) %>
|
||||
conditions: link_to(t("form.conditions"), "/conditions", target: "blank")) %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -26,7 +26,8 @@
|
||||
url: legislation_process_proposal_path(
|
||||
proposal.legislation_process_id,
|
||||
proposal,
|
||||
anchor: "comments")
|
||||
anchor: "comments"
|
||||
)
|
||||
) %>
|
||||
|
||||
<% if proposal.author.hidden? || proposal.author.erased? %>
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
<%= sanitize(
|
||||
t("mailers.budget_investment_created.follow",
|
||||
t(
|
||||
"mailers.budget_investment_created.follow",
|
||||
link: link_to(t("mailers.budget_investment_created.follow_link"),
|
||||
budgets_url,
|
||||
style: css_for_mailer_link)
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
<%= sanitize(
|
||||
t("mailers.budget_investment_unfeasible.new",
|
||||
t(
|
||||
"mailers.budget_investment_unfeasible.new",
|
||||
url: link_to(t("mailers.budget_investment_unfeasible.new_href"),
|
||||
new_budget_investment_url(@investment.budget),
|
||||
style: css_for_mailer_link)
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
<%= sanitize(
|
||||
t("mailers.config.unsubscribe_text",
|
||||
t(
|
||||
"mailers.config.unsubscribe_text",
|
||||
notifications: link_to(
|
||||
t("mailers.config.notifications_link"),
|
||||
edit_subscriptions_url(token: @token),
|
||||
|
||||
@@ -22,11 +22,13 @@
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
<%= sanitize(
|
||||
t("mailers.direct_message_for_receiver.unsubscribe_text",
|
||||
t(
|
||||
"mailers.direct_message_for_receiver.unsubscribe_text",
|
||||
notifications: link_to(
|
||||
t("mailers.config.notifications_link"),
|
||||
edit_subscriptions_url(token: @token),
|
||||
style: css_for_mailer_link)
|
||||
style: css_for_mailer_link
|
||||
)
|
||||
),
|
||||
attributes: %w[href style]
|
||||
) %>
|
||||
|
||||
@@ -10,11 +10,13 @@
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
<%= sanitize(
|
||||
t("mailers.email_verification.instructions",
|
||||
t(
|
||||
"mailers.email_verification.instructions",
|
||||
verification_link: link_to(
|
||||
t("mailers.email_verification.click_here_to_verify"),
|
||||
email_url(email_verification_token: @token),
|
||||
style: css_for_mailer_link)
|
||||
style: css_for_mailer_link
|
||||
)
|
||||
),
|
||||
attributes: %w[href style]
|
||||
) %>
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
<%= sanitize(
|
||||
t("mailers.evaluation_comment.new_comment_by",
|
||||
commenter: @email.comment.author.name,
|
||||
investment: valuation_comments_link(@email.commentable)
|
||||
)
|
||||
investment: valuation_comments_link(@email.commentable))
|
||||
) %>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
<%= sanitize(
|
||||
t("mailers.config.unsubscribe_text",
|
||||
t(
|
||||
"mailers.config.unsubscribe_text",
|
||||
notifications: link_to(
|
||||
t("mailers.config.notifications_link"),
|
||||
edit_subscriptions_url(token: @token),
|
||||
|
||||
@@ -64,11 +64,13 @@
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
<%= sanitize(
|
||||
t("mailers.proposal_notification_digest.unsubscribe_text",
|
||||
t(
|
||||
"mailers.proposal_notification_digest.unsubscribe_text",
|
||||
notifications: link_to(
|
||||
t("mailers.config.notifications_link"),
|
||||
edit_subscriptions_url(token: @token),
|
||||
style: css_for_mailer_link)
|
||||
style: css_for_mailer_link
|
||||
)
|
||||
),
|
||||
attributes: %w[href style]
|
||||
) %>
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
|
||||
<p style="<%= css_for_mailer_text %>">
|
||||
<%= sanitize(
|
||||
t("mailers.config.unsubscribe_text",
|
||||
t(
|
||||
"mailers.config.unsubscribe_text",
|
||||
notifications: link_to(
|
||||
t("mailers.config.notifications_link"),
|
||||
edit_subscriptions_url(token: @token),
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
terms: link_to(t("devise_views.users.registrations.new.terms_link"),
|
||||
"/conditions",
|
||||
title: t("shared.target_blank"),
|
||||
target: "_blank")
|
||||
) %>
|
||||
target: "_blank")) %>
|
||||
|
||||
<div class="small-12 medium-6 small-centered">
|
||||
<%= f.submit t("devise_views.organizations.registrations.new.submit"), class: "button expanded" %>
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
<% stats.channels.each do |channel| %>
|
||||
<%= number_with_info_tags(
|
||||
stats.send("total_participants_#{channel}"),
|
||||
t("stats.polls.#{channel}_percentage",
|
||||
t(
|
||||
"stats.polls.#{channel}_percentage",
|
||||
percentage: number_to_stats_percentage(stats.send(:"total_participants_#{channel}_percentage"))
|
||||
),
|
||||
html_class: channel
|
||||
|
||||
@@ -37,10 +37,10 @@
|
||||
<%= f.check_box :terms_of_service,
|
||||
title: t("devise_views.users.registrations.new.terms_title"),
|
||||
label: t("devise_views.users.registrations.new.terms",
|
||||
terms: link_to(t("devise_views.users.registrations.new.terms_link"), "/conditions",
|
||||
terms: link_to(t("devise_views.users.registrations.new.terms_link"),
|
||||
"/conditions",
|
||||
title: t("shared.target_blank"),
|
||||
target: "_blank")
|
||||
) %>
|
||||
target: "_blank")) %>
|
||||
|
||||
<div class="small-12 medium-6 small-centered">
|
||||
<%= f.submit t("devise_views.users.registrations.new.submit"), class: "button expanded" %>
|
||||
|
||||
@@ -71,10 +71,10 @@
|
||||
<%= f.check_box :terms_of_service,
|
||||
title: t("verification.residence.new.accept_terms_text_title"),
|
||||
label: t("verification.residence.new.accept_terms_text",
|
||||
terms_url: link_to(t("verification.residence.new.terms"), page_path("census_terms"),
|
||||
terms_url: link_to(t("verification.residence.new.terms"),
|
||||
page_path("census_terms"),
|
||||
title: t("shared.target_blank"),
|
||||
target: "_blank")
|
||||
) %>
|
||||
target: "_blank")) %>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 clear">
|
||||
|
||||
@@ -4,8 +4,7 @@ describe SDG::TagListComponent do
|
||||
let(:debate) do
|
||||
create(:debate,
|
||||
sdg_goals: [SDG::Goal[3]],
|
||||
sdg_targets: [SDG::Target[3.2], create(:sdg_local_target, code: "3.2.1")]
|
||||
)
|
||||
sdg_targets: [SDG::Target[3.2], create(:sdg_local_target, code: "3.2.1")])
|
||||
end
|
||||
let(:component) { SDG::TagListComponent.new(debate) }
|
||||
|
||||
|
||||
@@ -3,8 +3,7 @@ require "rails_helper"
|
||||
describe SDG::Targets::PlainTagListComponent do
|
||||
let(:debate) do
|
||||
create(:debate,
|
||||
sdg_targets: [SDG::Target[1.1], SDG::Target[3.2], create(:sdg_local_target, code: "3.2.1")]
|
||||
)
|
||||
sdg_targets: [SDG::Target[1.1], SDG::Target[3.2], create(:sdg_local_target, code: "3.2.1")])
|
||||
end
|
||||
let(:component) { SDG::Targets::PlainTagListComponent.new(debate) }
|
||||
|
||||
|
||||
@@ -3,8 +3,7 @@ require "rails_helper"
|
||||
describe SDG::Targets::TagListComponent do
|
||||
let(:debate) do
|
||||
create(:debate,
|
||||
sdg_targets: [SDG::Target[1.1], SDG::Target[3.2], create(:sdg_local_target, code: "3.2.1")]
|
||||
)
|
||||
sdg_targets: [SDG::Target[1.1], SDG::Target[3.2], create(:sdg_local_target, code: "3.2.1")])
|
||||
end
|
||||
let(:component) { SDG::Targets::TagListComponent.new(debate) }
|
||||
|
||||
|
||||
@@ -9,8 +9,7 @@ describe Shared::BannerComponent do
|
||||
post_started_at: (Date.current - 4.days),
|
||||
post_ended_at: (Date.current + 10.days),
|
||||
background_color: "#FF0000",
|
||||
font_color: "#FFFFFF"
|
||||
)
|
||||
font_color: "#FFFFFF")
|
||||
|
||||
render_inline Shared::BannerComponent.new(banner)
|
||||
|
||||
@@ -38,15 +37,13 @@ describe Shared::BannerComponent do
|
||||
web_sections: [WebSection.find_by!(name: "debates")],
|
||||
title: "First banner",
|
||||
description: "First description",
|
||||
target_url: "/first_target"
|
||||
)
|
||||
target_url: "/first_target")
|
||||
|
||||
create(:banner,
|
||||
web_sections: [WebSection.find_by!(name: "debates")],
|
||||
title: "Second banner",
|
||||
description: "Second description",
|
||||
target_url: "/second_target"
|
||||
)
|
||||
target_url: "/second_target")
|
||||
end
|
||||
|
||||
it "only renders one banner" do
|
||||
|
||||
@@ -77,8 +77,7 @@ describe Budget::Stats do
|
||||
|
||||
it "doesn't count nil user ids" do
|
||||
create(:budget_ballot_line, investment: investment,
|
||||
ballot: create(:budget_ballot, budget: budget.reload, user: nil, physical: true)
|
||||
)
|
||||
ballot: create(:budget_ballot, budget: budget.reload, user: nil, physical: true))
|
||||
|
||||
expect(stats.total_participants_vote_phase).to be 0
|
||||
end
|
||||
|
||||
@@ -73,7 +73,8 @@ describe Geozone do
|
||||
expect(geozone.outline_points).to eq(
|
||||
[[-3.9259027239257, 40.8792937308316],
|
||||
[-3.9249047078766, 40.8788966596619],
|
||||
[-3.9247799675785, 40.8789131852224]])
|
||||
[-3.9247799675785, 40.8789131852224]]
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -937,8 +937,7 @@ describe "Admin budget investments", :admin do
|
||||
price: 1234,
|
||||
price_first_year: 1000,
|
||||
administrator: administrator,
|
||||
valuators: [valuator]
|
||||
)
|
||||
valuators: [valuator])
|
||||
|
||||
visit admin_budget_budget_investments_path(budget_investment.budget)
|
||||
|
||||
@@ -1757,8 +1756,7 @@ describe "Admin budget investments", :admin do
|
||||
:winner,
|
||||
:visible_to_valuators,
|
||||
budget: budget,
|
||||
author: create(:user, username: "Jon Doe")
|
||||
)
|
||||
author: create(:user, username: "Jon Doe"))
|
||||
end
|
||||
let(:default_columns) do
|
||||
%w[id title supports admin valuator geozone feasibility price
|
||||
|
||||
@@ -496,7 +496,8 @@ describe "Emails" do
|
||||
expect(email.body.encoded).to include("This is a different body")
|
||||
expect(email).to have_body_text("To unsubscribe from these emails, visit")
|
||||
expect(email).to have_body_text(
|
||||
edit_subscriptions_path(token: user_with_newsletter_in_segment_2.subscriptions_token))
|
||||
edit_subscriptions_path(token: user_with_newsletter_in_segment_2.subscriptions_token)
|
||||
)
|
||||
expect(email).to have_body_text('and uncheck "Receive relevant information by email"')
|
||||
end
|
||||
end
|
||||
|
||||
@@ -401,8 +401,7 @@ describe "Legislation" do
|
||||
create(:milestone,
|
||||
milestoneable: process,
|
||||
description: "Something important happened",
|
||||
publication_date: Date.new(2018, 3, 22)
|
||||
)
|
||||
publication_date: Date.new(2018, 3, 22))
|
||||
|
||||
visit legislation_process_path(process)
|
||||
|
||||
|
||||
@@ -22,8 +22,7 @@ describe "Legislation" do
|
||||
scenario "empty process" do
|
||||
process = create(:legislation_process, :empty,
|
||||
result_publication_enabled: true,
|
||||
end_date: Date.current - 1.day
|
||||
)
|
||||
end_date: Date.current - 1.day)
|
||||
|
||||
visit summary_legislation_process_path(process)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user