From 12fa241027f0b9c37eaf5b86ca064a8f93eed6a5 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 28 Sep 2020 19:50:29 +0000 Subject: [PATCH 01/16] Bump erb_lint from 0.0.28 to 0.0.35 Bumps [erb_lint](https://github.com/Shopify/erb-lint) from 0.0.28 to 0.0.35. - [Release notes](https://github.com/Shopify/erb-lint/releases) - [Commits](https://github.com/Shopify/erb-lint/compare/v0.0.28...v0.0.35) Signed-off-by: dependabot-preview[bot] --- Gemfile.lock | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 59b833970..3b95a30a6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -80,7 +80,7 @@ GEM babel-source (>= 4.0, < 6) execjs (~> 2.0) bcrypt (3.1.16) - better_html (1.0.13) + better_html (1.0.15) actionview (>= 4.0) activesupport (>= 4.0) ast (~> 2.0) @@ -208,12 +208,13 @@ GEM htmlentities (~> 4.3.3) launchy (~> 2.1) mail (~> 2.7) - erb_lint (0.0.28) + erb_lint (0.0.35) activesupport better_html (~> 1.0.7) html_tokenizer + parser (>= 2.7.1.4) rainbow - rubocop (~> 0.51) + rubocop (~> 0.79) smart_properties errbase (0.0.3) erubi (1.9.0) @@ -555,7 +556,7 @@ GEM simplecov-html (0.10.2) sitemap_generator (6.1.2) builder (~> 3.0) - smart_properties (1.13.1) + smart_properties (1.15.0) social-share-button (1.1.0) coffee-rails socksify (1.7.1) From 9b0026061ebd163bf3d39c54098408ae02ca3a85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Tue, 29 Sep 2020 22:12:11 +0200 Subject: [PATCH 02/16] Specify erb_lint version in Gemfile Just like we do for the rest of the gems. --- Gemfile | 2 +- Gemfile.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 61c9b7a10..c8e81f860 100644 --- a/Gemfile +++ b/Gemfile @@ -99,7 +99,7 @@ group :development do gem "capistrano-rails", "~> 1.6.1", require: false gem "capistrano3-delayed-job", "~> 1.7.6" gem "capistrano3-puma", "~> 4.0.0" - gem "erb_lint", require: false + gem "erb_lint", "~> 0.0.35", require: false gem "github_changelog_generator", "~> 1.15.2" gem "mdl", "~> 0.11.0", require: false gem "rubocop", "~> 0.91.0", require: false diff --git a/Gemfile.lock b/Gemfile.lock index 3b95a30a6..3dc9a30fb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -671,7 +671,7 @@ DEPENDENCIES devise-async (~> 1.0.0) devise-security (~> 0.11.1) email_spec (~> 2.2.0) - erb_lint + erb_lint (~> 0.0.35) factory_bot_rails (~> 4.8.2) faker (~> 1.8.7) font-awesome-sass (~> 5.15.1) From f864156b21bd27fcda662a697535f17bac5d1b23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sun, 5 Jul 2020 04:09:33 +0200 Subject: [PATCH 03/16] Add and apply ClosingErbTagIndent ERB Lint rule Note this rule does still allow us to add new lines after opening tags; it just makes sure that if we do, we also add it in closing tags. Likewise, if we don't add it in the opening tag, it forces us not to add it in the closing tag either. I don't have a strong preference about either style; in these cases I've chosen the latter because it seemed more common in our code. --- .erb-lint.yml | 2 ++ app/views/admin/shared/_budget_investment_search.html.erb | 3 +-- app/views/budgets/investments/_investment.html.erb | 6 ++---- app/views/budgets/investments/_investment_show.html.erb | 3 +-- app/views/budgets/investments/_votes.html.erb | 3 +-- app/views/budgets/investments/show.html.erb | 3 +-- app/views/debates/show.html.erb | 3 +-- .../legislation/annotations/_slim_version_chooser.html.erb | 3 +-- app/views/legislation/annotations/show.html.erb | 3 +-- app/views/legislation/processes/_header.html.erb | 3 +-- app/views/legislation/proposals/_featured_votes.html.erb | 3 +-- app/views/legislation/proposals/_votes.html.erb | 3 +-- app/views/legislation/proposals/show.html.erb | 3 +-- app/views/management/_user_permissions.html.erb | 6 ++---- app/views/management/budgets/investments/index.html.erb | 3 +-- app/views/management/budgets/investments/print.html.erb | 3 +-- app/views/management/budgets/investments/show.html.erb | 3 +-- app/views/polls/_poll_header.html.erb | 3 +-- app/views/proposals/_featured_votes.html.erb | 3 +-- app/views/proposals/share.html.erb | 3 +-- app/views/shared/_wide_order_selector.html.erb | 3 +-- 21 files changed, 24 insertions(+), 44 deletions(-) diff --git a/.erb-lint.yml b/.erb-lint.yml index e87a778f8..6f3ce44df 100644 --- a/.erb-lint.yml +++ b/.erb-lint.yml @@ -1,5 +1,7 @@ --- linters: + ClosingErbTagIndent: + enabled: true ErbSafety: enabled: true ExtraNewline: diff --git a/app/views/admin/shared/_budget_investment_search.html.erb b/app/views/admin/shared/_budget_investment_search.html.erb index f29a3a0d1..86f77dfc5 100644 --- a/app/views/admin/shared/_budget_investment_search.html.erb +++ b/app/views/admin/shared/_budget_investment_search.html.erb @@ -7,8 +7,7 @@ <%= select_tag :heading_id, options_for_select(budget_heading_select_options(@budget), params[:heading_id]), - include_blank: true - %> + include_blank: true %>
diff --git a/app/views/budgets/investments/_investment.html.erb b/app/views/budgets/investments/_investment.html.erb index c3863f9ce..8d1464a9f 100644 --- a/app/views/budgets/investments/_investment.html.erb +++ b/app/views/budgets/investments/_investment.html.erb @@ -63,8 +63,7 @@ <%= render "/budgets/investments/votes", investment: investment, investment_votes: investment_votes, - vote_url: namespaced_budget_investment_vote_path(investment, value: "yes") - %> + vote_url: namespaced_budget_investment_vote_path(investment, value: "yes") %>
<% elsif investment.should_show_vote_count? %>
+ ballot: ballot %>
<% elsif investment.should_show_price? %>
+ vote_url: vote_budget_investment_path(investment.budget, investment, value: "yes") %>
<% elsif investment.should_show_vote_count? %> diff --git a/app/views/budgets/investments/_votes.html.erb b/app/views/budgets/investments/_votes.html.erb index b4733a29b..e520ec3cc 100644 --- a/app/views/budgets/investments/_votes.html.erb +++ b/app/views/budgets/investments/_votes.html.erb @@ -50,8 +50,7 @@ image_url: image_absolute_url(investment.image, :thumb), url: budget_investment_url(investment.budget, investment), description: investment.title, - mobile: investment.title - %> + mobile: investment.title %> <% end %> diff --git a/app/views/budgets/investments/show.html.erb b/app/views/budgets/investments/show.html.erb index b0eee0ec3..bc3976ead 100644 --- a/app/views/budgets/investments/show.html.erb +++ b/app/views/budgets/investments/show.html.erb @@ -7,8 +7,7 @@ investment: @investment, investment_ids: @investment_ids, investment_votes: @investment_votes, - ballot: @ballot -%> + ballot: @ballot %>
diff --git a/app/views/debates/show.html.erb b/app/views/debates/show.html.erb index 6889122f8..deebcaf54 100644 --- a/app/views/debates/show.html.erb +++ b/app/views/debates/show.html.erb @@ -61,8 +61,7 @@ title: @debate.title, url: debate_url(@debate), description: @debate.title, - mobile: @debate.title - %> + mobile: @debate.title %>
diff --git a/app/views/legislation/annotations/_slim_version_chooser.html.erb b/app/views/legislation/annotations/_slim_version_chooser.html.erb index 996a93bfb..4cd42df39 100644 --- a/app/views/legislation/annotations/_slim_version_chooser.html.erb +++ b/app/views/legislation/annotations/_slim_version_chooser.html.erb @@ -20,7 +20,6 @@

<%= t("legislation.shared.share") %>

<%= render "/shared/social_share", title: t("legislation.shared.share_comment", version_name: @draft_version.title.downcase, process_name: @process.title), - url: legislation_process_draft_version_path(process, draft_version) - %> + url: legislation_process_draft_version_path(process, draft_version) %> diff --git a/app/views/legislation/annotations/show.html.erb b/app/views/legislation/annotations/show.html.erb index 6b4cbd331..3015cdd4c 100644 --- a/app/views/legislation/annotations/show.html.erb +++ b/app/views/legislation/annotations/show.html.erb @@ -39,8 +39,7 @@

<%= t("legislation.shared.share") %>

<%= render "/shared/social_share", title: t("legislation.shared.share_comment", version_name: @draft_version.title.downcase, process_name: @process.title), - url: legislation_process_draft_version_annotations_path(@process, @draft_version) - %> + url: legislation_process_draft_version_annotations_path(@process, @draft_version) %> diff --git a/app/views/legislation/processes/_header.html.erb b/app/views/legislation/processes/_header.html.erb index c5e462040..f0be35496 100644 --- a/app/views/legislation/processes/_header.html.erb +++ b/app/views/legislation/processes/_header.html.erb @@ -41,8 +41,7 @@ title: @process.title, url: legislation_process_url(@process), description: @process.title, - mobile: @process.title - %> + mobile: @process.title %> <% if @process.image.present? %>
diff --git a/app/views/legislation/proposals/_featured_votes.html.erb b/app/views/legislation/proposals/_featured_votes.html.erb index 979d2e90b..4c42406b0 100644 --- a/app/views/legislation/proposals/_featured_votes.html.erb +++ b/app/views/legislation/proposals/_featured_votes.html.erb @@ -36,8 +36,7 @@ title: proposal.title, url: proposal_url(proposal), description: proposal.summary, - mobile: proposal.title - %> + mobile: proposal.title %> <% end %> <% end %> diff --git a/app/views/legislation/proposals/_votes.html.erb b/app/views/legislation/proposals/_votes.html.erb index e60c4e2d4..d78c24c4d 100644 --- a/app/views/legislation/proposals/_votes.html.erb +++ b/app/views/legislation/proposals/_votes.html.erb @@ -70,8 +70,7 @@ title: proposal.title, url: proposal_url(proposal), description: proposal.summary, - mobile: proposal.title - %> + mobile: proposal.title %> <% end %> diff --git a/app/views/legislation/proposals/show.html.erb b/app/views/legislation/proposals/show.html.erb index fdf7347a7..6d0baea0e 100644 --- a/app/views/legislation/proposals/show.html.erb +++ b/app/views/legislation/proposals/show.html.erb @@ -110,8 +110,7 @@ title: @proposal.title, url: legislation_process_proposal_url(process_id: @process), description: @proposal.summary, - mobile: @proposal.title - %> + mobile: @proposal.title %> diff --git a/app/views/management/_user_permissions.html.erb b/app/views/management/_user_permissions.html.erb index b6c5d6b95..44778fb3e 100644 --- a/app/views/management/_user_permissions.html.erb +++ b/app/views/management/_user_permissions.html.erb @@ -1,9 +1,7 @@ -<% - # Parameters: +<% # Parameters: # message: A string explaining the permissions # permissions: An array of symbols containing the permissions - # (can be :debates, :proposal, :support_proposal, :votes) -%> + # (can be :debates, :proposal, :support_proposal, :votes) %>

<%= message %>

diff --git a/app/views/management/budgets/investments/index.html.erb b/app/views/management/budgets/investments/index.html.erb index 9343f3519..e44f904de 100644 --- a/app/views/management/budgets/investments/index.html.erb +++ b/app/views/management/budgets/investments/index.html.erb @@ -22,8 +22,7 @@ investment: investment, investment_ids: @investment_ids, investment_votes: @investment_votes, - ballot: @ballot - %> + ballot: @ballot %> <% end %> <%= paginate @investments %> diff --git a/app/views/management/budgets/investments/print.html.erb b/app/views/management/budgets/investments/print.html.erb index 79b991e69..f6fcc4bab 100644 --- a/app/views/management/budgets/investments/print.html.erb +++ b/app/views/management/budgets/investments/print.html.erb @@ -27,8 +27,7 @@ investment: investment, investment_ids: @investment_ids, investment_votes: @investment_votes, - ballot: @ballot - %> + ballot: @ballot %> <% end %>
diff --git a/app/views/management/budgets/investments/show.html.erb b/app/views/management/budgets/investments/show.html.erb index a2451c239..99dea2eaa 100644 --- a/app/views/management/budgets/investments/show.html.erb +++ b/app/views/management/budgets/investments/show.html.erb @@ -4,5 +4,4 @@ <%= render "/budgets/investments/investment_show", investment: @investment, - investment_votes: @investment_votes -%> + investment_votes: @investment_votes %> diff --git a/app/views/polls/_poll_header.html.erb b/app/views/polls/_poll_header.html.erb index 71e9ae622..77e95679d 100644 --- a/app/views/polls/_poll_header.html.erb +++ b/app/views/polls/_poll_header.html.erb @@ -27,8 +27,7 @@ title: @poll.name, url: poll_url(@poll), description: @poll.name, - mobile: @poll.name - %> + mobile: @poll.name %>
diff --git a/app/views/proposals/_featured_votes.html.erb b/app/views/proposals/_featured_votes.html.erb index 979d2e90b..4c42406b0 100644 --- a/app/views/proposals/_featured_votes.html.erb +++ b/app/views/proposals/_featured_votes.html.erb @@ -36,8 +36,7 @@ title: proposal.title, url: proposal_url(proposal), description: proposal.summary, - mobile: proposal.title - %> + mobile: proposal.title %> <% end %> <% end %> diff --git a/app/views/proposals/share.html.erb b/app/views/proposals/share.html.erb index bf474c284..9c390107a 100644 --- a/app/views/proposals/share.html.erb +++ b/app/views/proposals/share.html.erb @@ -25,8 +25,7 @@ title: @proposal.title, url: proposal_url(@proposal), description: @proposal.summary, - mobile: @proposal.title - %> + mobile: @proposal.title %> <% if can?(:dashboard, @proposal) %>
diff --git a/app/views/shared/_wide_order_selector.html.erb b/app/views/shared/_wide_order_selector.html.erb index 10f7f962f..2aa092cbd 100644 --- a/app/views/shared/_wide_order_selector.html.erb +++ b/app/views/shared/_wide_order_selector.html.erb @@ -1,7 +1,6 @@ <% # Params: # - # i18n_namespace: for example "moderation.debates.index" -%> + # i18n_namespace: for example "moderation.debates.index" %> <% if @valid_orders.present? && @valid_orders.count > 1 %>
From 32ef8ff301f03c1132fea38db23303aede7ef75d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 5 Jul 2019 04:14:15 +0200 Subject: [PATCH 04/16] Unify Ruby and ERB Rubocop rules So now we remove duplication between .rubocop.yml and the rubocop rules defined for erblint. Having the rules in two places led to some mistakes, like renaming Layout/Tab to Layout/IndentationStyle in `.rubocop.yml` but forgetting to do so in `.erb-lint.yml`. This also means we can use the EnforcedStyle options for Layout/SpaceInsideHashLiteralBraces in views as well. We couldn't implement this feature earlier because it required Ruby 2.4 and due to incompatibilities between versions of erb_lint and versions of rubocop. There are some rules which do not apply to ERB files and so we're disabling them. * Layout/LineLength, Layout/TrailingEmptyLines and Lint/UselssAssignment generate false positives * Rails/OutputSafety is redundant since its functionality is already covered by ERB Lint ErbSafety linter --- .erb-lint.yml | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/.erb-lint.yml b/.erb-lint.yml index 6f3ce44df..ec457aa0c 100644 --- a/.erb-lint.yml +++ b/.erb-lint.yml @@ -20,29 +20,14 @@ linters: enabled: true Rubocop: enabled: true - only: - - 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 - - Style/PercentLiteralDelimiters + rubocop_config: + inherit_from: + - .rubocop.yml + Layout/LineLength: + Enabled: false + Layout/TrailingEmptyLines: + Enabled: false + Lint/UselessAssignment: + Enabled: false + Rails/OutputSafety: + Enabled: false From 67c65154054c710ea99fd2a4fb693256d14b6a57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 30 Sep 2020 20:56:27 +0200 Subject: [PATCH 05/16] Apply Style/CollectionMethods rule to ERB files --- app/views/admin/budget_investments/edit.html.erb | 2 +- app/views/admin/budget_investments/show.html.erb | 4 ++-- app/views/admin/milestones/_form.html.erb | 2 +- app/views/officing/booth/new.html.erb | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/admin/budget_investments/edit.html.erb b/app/views/admin/budget_investments/edit.html.erb index 7aaddf857..e1bed238b 100644 --- a/app/views/admin/budget_investments/edit.html.erb +++ b/app/views/admin/budget_investments/edit.html.erb @@ -52,7 +52,7 @@
<%= f.select(:administrator_id, - @admins.collect { |a| [a.description_or_name_and_email, a.id] }, + @admins.map { |a| [a.description_or_name_and_email, a.id] }, { include_blank: t("admin.budget_investments.edit.undefined") }) %>
diff --git a/app/views/admin/budget_investments/show.html.erb b/app/views/admin/budget_investments/show.html.erb index 3727c5f4b..7d1ceb8b5 100644 --- a/app/views/admin/budget_investments/show.html.erb +++ b/app/views/admin/budget_investments/show.html.erb @@ -37,7 +37,7 @@

<%= t("admin.budget_investments.show.valuator_groups") %>: <% if @investment.valuator_groups.any? %> - <%= @investment.valuator_groups.collect(&:name).join(", ") %> + <%= @investment.valuator_groups.map(&:name).join(", ") %> <% else %> <%= t("admin.budget_investments.show.undefined") %> <% end %> @@ -46,7 +46,7 @@

<%= t("admin.budget_investments.show.assigned_valuators") %>: <% if @investment.valuators.any? %> - <%= @investment.valuators.collect(&:name_and_email).join(", ") %> + <%= @investment.valuators.map(&:name_and_email).join(", ") %> <% else %> <%= t("admin.budget_investments.show.undefined") %> <% end %> diff --git a/app/views/admin/milestones/_form.html.erb b/app/views/admin/milestones/_form.html.erb index a10a09aab..07fe07e8b 100644 --- a/app/views/admin/milestones/_form.html.erb +++ b/app/views/admin/milestones/_form.html.erb @@ -5,7 +5,7 @@

<%= f.select :status_id, - @statuses.collect { |s| [s.name, s.id] }, + @statuses.map { |s| [s.name, s.id] }, { include_blank: @statuses.any? ? "" : t("admin.milestones.form.no_statuses_defined") }, { disabled: @statuses.blank? } %> <%= link_to t("admin.milestones.form.admin_statuses"), diff --git a/app/views/officing/booth/new.html.erb b/app/views/officing/booth/new.html.erb index 6cbfeda0f..0b4cda988 100644 --- a/app/views/officing/booth/new.html.erb +++ b/app/views/officing/booth/new.html.erb @@ -11,7 +11,7 @@
<%= f.select :id, - @booths.collect { |booth| [booth.location, booth.id] }, + @booths.map { |booth| [booth.location, booth.id] }, selected: @booths.first, label: false, tabindex: "1" %> From 4809a87a78c212038b7cc9882f537fd99ed4a542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 30 Sep 2020 21:00:20 +0200 Subject: [PATCH 06/16] Apply Style/HashSyntax rule in ERB files --- .../admin/site_customization/information_texts/_tabs.html.erb | 2 +- app/views/devise/password_expired/show.html.erb | 2 +- app/views/kaminari/_first_page.html.erb | 2 +- app/views/kaminari/_last_page.html.erb | 2 +- app/views/kaminari/_next_page.html.erb | 2 +- app/views/kaminari/_page.html.erb | 2 +- app/views/kaminari/_prev_page.html.erb | 2 +- app/views/legislation/proposals/_form.html.erb | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/views/admin/site_customization/information_texts/_tabs.html.erb b/app/views/admin/site_customization/information_texts/_tabs.html.erb index 4947e2a8c..a4a5b1822 100644 --- a/app/views/admin/site_customization/information_texts/_tabs.html.erb +++ b/app/views/admin/site_customization/information_texts/_tabs.html.erb @@ -2,7 +2,7 @@ <% information_texts_tabs.each do |tab| %>
  • <% if tab.to_s == @tab %> - <%= link_to t("admin.menu.site_customization.information_texts_menu.#{tab}"), admin_site_customization_information_texts_path(tab: tab), :class => "is-active" %> + <%= link_to t("admin.menu.site_customization.information_texts_menu.#{tab}"), admin_site_customization_information_texts_path(tab: tab), class: "is-active" %> <% else %> <%= link_to t("admin.menu.site_customization.information_texts_menu.#{tab}"), admin_site_customization_information_texts_path(tab: tab) %> <% end %> diff --git a/app/views/devise/password_expired/show.html.erb b/app/views/devise/password_expired/show.html.erb index ac3fd10ae..8eb10f6b4 100644 --- a/app/views/devise/password_expired/show.html.erb +++ b/app/views/devise/password_expired/show.html.erb @@ -1,6 +1,6 @@

    <%= t("devise.password_expired.expire_password") %>

    -<%= form_for(resource, :as => resource_name, :url => [resource_name, :password_expired], :html => { :method => :put }) do |f| %> +<%= form_for(resource, as: resource_name, url: [resource_name, :password_expired], html: { method: :put }) do |f| %> <%= f.password_field :current_password %>

    <%= f.password_field :password, label: t("devise.password_expired.new_password") %>

    diff --git a/app/views/kaminari/_first_page.html.erb b/app/views/kaminari/_first_page.html.erb index c97a20740..439f3257c 100644 --- a/app/views/kaminari/_first_page.html.erb +++ b/app/views/kaminari/_first_page.html.erb @@ -1,3 +1,3 @@
  • - <%= link_to t("views.pagination.first"), url, :remote => remote %> + <%= link_to t("views.pagination.first"), url, remote: remote %>
  • diff --git a/app/views/kaminari/_last_page.html.erb b/app/views/kaminari/_last_page.html.erb index cc2929aa0..c5a7831f5 100644 --- a/app/views/kaminari/_last_page.html.erb +++ b/app/views/kaminari/_last_page.html.erb @@ -1,3 +1,3 @@
  • - <%= link_to t("views.pagination.last"), url, :remote => remote %> + <%= link_to t("views.pagination.last"), url, remote: remote %>
  • diff --git a/app/views/kaminari/_next_page.html.erb b/app/views/kaminari/_next_page.html.erb index 6da585a67..0d1b188f0 100644 --- a/app/views/kaminari/_next_page.html.erb +++ b/app/views/kaminari/_next_page.html.erb @@ -1,3 +1,3 @@
  • - <%= link_to t("views.pagination.next"), url, :rel => "next", :remote => remote %> + <%= link_to t("views.pagination.next"), url, rel: "next", remote: remote %>
  • diff --git a/app/views/kaminari/_page.html.erb b/app/views/kaminari/_page.html.erb index c82b8968c..1a2625540 100644 --- a/app/views/kaminari/_page.html.erb +++ b/app/views/kaminari/_page.html.erb @@ -5,6 +5,6 @@ <% else %>
  • - <%= link_to page, url, { :remote => remote, :rel => page.next? ? "next" : page.prev? ? "prev" : nil } %> + <%= link_to page, url, { remote: remote, rel: page.next? ? "next" : page.prev? ? "prev" : nil } %>
  • <% end %> diff --git a/app/views/kaminari/_prev_page.html.erb b/app/views/kaminari/_prev_page.html.erb index 2ee045967..5ed7ef3a3 100644 --- a/app/views/kaminari/_prev_page.html.erb +++ b/app/views/kaminari/_prev_page.html.erb @@ -1,3 +1,3 @@
  • - <%= link_to t("views.pagination.previous"), url, :rel => "prev", :remote => remote %> + <%= link_to t("views.pagination.previous"), url, rel: "prev", remote: remote %>
  • diff --git a/app/views/legislation/proposals/_form.html.erb b/app/views/legislation/proposals/_form.html.erb index 9985bfa03..f1f8aef59 100644 --- a/app/views/legislation/proposals/_form.html.erb +++ b/app/views/legislation/proposals/_form.html.erb @@ -1,7 +1,7 @@ <%= form_for(@proposal, url: form_url) do |f| %> <%= render "shared/errors", resource: @proposal %> - <%= f.hidden_field(:legislation_process_id, :value => params[:process_id]) %> + <%= f.hidden_field(:legislation_process_id, value: params[:process_id]) %>
    From 2d37a0396b1f85dac5fbac58378f89c5cddfc25a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 30 Sep 2020 21:04:37 +0200 Subject: [PATCH 07/16] Apply Layout/ExtraSpacing rule in ERB files Note that in Ruby files this rule allows vertical alignment, but doesn't seem to do the same in ERB. Since we only used vertical alignment in one place, and that place also had an unneeded extra space on every aligned line, I've decided to change the code in that place and follow the rule. --- app/views/admin/settings/_map_form.html.erb | 6 +++--- app/views/mailer/budget_investment_created.html.erb | 2 +- app/views/mailer/budget_investment_selected.html.erb | 2 +- app/views/mailer/proposal_notification_digest.html.erb | 4 ++-- app/views/organizations/registrations/new.html.erb | 2 +- app/views/users/registrations/new.html.erb | 2 +- .../valuation/budget_investments/_dossier_form.html.erb | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/views/admin/settings/_map_form.html.erb b/app/views/admin/settings/_map_form.html.erb index 49d2496f2..8c85666f7 100644 --- a/app/views/admin/settings/_map_form.html.erb +++ b/app/views/admin/settings/_map_form.html.erb @@ -17,9 +17,9 @@ <%= form_tag admin_update_map_path, method: :put, id: "map-form" do |f| %> - <%= hidden_field_tag :latitude, Setting["map.latitude"] %> - <%= hidden_field_tag :longitude, Setting["map.longitude"] %> - <%= hidden_field_tag :zoom, Setting["map.zoom"] %> + <%= hidden_field_tag :latitude, Setting["map.latitude"] %> + <%= hidden_field_tag :longitude, Setting["map.longitude"] %> + <%= hidden_field_tag :zoom, Setting["map.zoom"] %>
    <%= submit_tag t("admin.settings.index.map.form.submit"), diff --git a/app/views/mailer/budget_investment_created.html.erb b/app/views/mailer/budget_investment_created.html.erb index c7a866112..3c0c29980 100644 --- a/app/views/mailer/budget_investment_created.html.erb +++ b/app/views/mailer/budget_investment_created.html.erb @@ -25,7 +25,7 @@ <%= link_to budget_investment_url(@investment.budget, @investment, anchor: "social-share"), style: "font-family: 'Open Sans','Helvetica Neue',arial,sans-serif; background: #f7f5f2; border-radius: 6px; color: #3d3d66!important; font-weight: bold; margin: 0px; padding: 10px 15px; text-align: center; text-decoration: none; min-width: 160px; display: inline-block;" do %> - <%= image_tag("icon_mailer_share.png", style: "border: 0; display: inline-block; width: 100%; max-width: 16px", alt: "") %> + <%= image_tag("icon_mailer_share.png", style: "border: 0; display: inline-block; width: 100%; max-width: 16px", alt: "") %> <%= t("mailers.budget_investment_created.share") %> <% end %> diff --git a/app/views/mailer/budget_investment_selected.html.erb b/app/views/mailer/budget_investment_selected.html.erb index 876c73443..08e3409b8 100644 --- a/app/views/mailer/budget_investment_selected.html.erb +++ b/app/views/mailer/budget_investment_selected.html.erb @@ -13,7 +13,7 @@ <%= link_to budget_investment_url(@investment.budget, @investment, anchor: "social-share"), style: "font-family: 'Open Sans','Helvetica Neue',arial,sans-serif; background: #f7f5f2; border-radius: 6px; color: #3d3d66 !important; font-weight: bold; margin: 0px; padding: 10px 15px; text-align: center; text-decoration: none; min-width: 160px; display: inline-block;" do %> - <%= image_tag("icon_mailer_share.png", style: "border: 0; display: inline-block; width: 100%; max-width: 16px", alt: "") %> + <%= image_tag("icon_mailer_share.png", style: "border: 0; display: inline-block; width: 100%; max-width: 16px", alt: "") %> <%= t("mailers.budget_investment_selected.share_button") %> <% end %> diff --git a/app/views/mailer/proposal_notification_digest.html.erb b/app/views/mailer/proposal_notification_digest.html.erb index d70ff3eef..576b592cd 100644 --- a/app/views/mailer/proposal_notification_digest.html.erb +++ b/app/views/mailer/proposal_notification_digest.html.erb @@ -38,12 +38,12 @@ <%= link_to proposal_url(notification.notifiable.proposal, anchor: "social-share"), style: "font-family: 'Open Sans','Helvetica Neue',arial,sans-serif; background: #f7f5f2; border-radius: 6px; color: #3d3d66!important; font-weight: bold; margin: 0px; padding: 10px 15px; text-align: center; text-decoration: none; min-width: 160px; display: inline-block;" do %> - <%= image_tag("icon_mailer_share.png", style: "border: 0; display: inline-block; width: 100%; max-width: 16px", alt: "") %> + <%= image_tag("icon_mailer_share.png", style: "border: 0; display: inline-block; width: 100%; max-width: 16px", alt: "") %> <%= t("mailers.proposal_notification_digest.share") %> <% end %> <%= link_to proposal_url(notification.notifiable.proposal, anchor: "comments"), style: "font-family: 'Open Sans','Helvetica Neue',arial,sans-serif; background: #f7f5f2; border-radius: 6px; color: #3d3d66!important; font-weight: bold; margin: 0px; padding: 10px 15px; text-align: center; text-decoration: none; min-width: 160px; display: inline-block; margin-left: 12px;" do %> - <%= image_tag("icon_mailer_comment.png", style: "border: 0; display: inline-block; width: 100%; max-width: 16px; vertical-align: middle;", alt: "") %> + <%= image_tag("icon_mailer_comment.png", style: "border: 0; display: inline-block; width: 100%; max-width: 16px; vertical-align: middle;", alt: "") %> <%= t("mailers.proposal_notification_digest.comment") %> <% end %> diff --git a/app/views/organizations/registrations/new.html.erb b/app/views/organizations/registrations/new.html.erb index 1f6b4b22e..ce0d4a025 100644 --- a/app/views/organizations/registrations/new.html.erb +++ b/app/views/organizations/registrations/new.html.erb @@ -16,7 +16,7 @@ <%= f.email_field :email, placeholder: t("devise_views.organizations.registrations.new.email_label") %> - <%= f.text_field :phone_number, placeholder: t("devise_views.organizations.registrations.new.phone_number_label") %> + <%= f.text_field :phone_number, placeholder: t("devise_views.organizations.registrations.new.phone_number_label") %> <%= f.invisible_captcha :address %> diff --git a/app/views/users/registrations/new.html.erb b/app/views/users/registrations/new.html.erb index 7dafa264f..888acbac6 100644 --- a/app/views/users/registrations/new.html.erb +++ b/app/views/users/registrations/new.html.erb @@ -23,7 +23,7 @@ <%= f.invisible_captcha :address %> - <%= f.email_field :email, placeholder: t("devise_views.users.registrations.new.email_label") %> + <%= f.email_field :email, placeholder: t("devise_views.users.registrations.new.email_label") %> <%= f.password_field :password, autocomplete: "off", placeholder: t("devise_views.users.registrations.new.password_label") %> diff --git a/app/views/valuation/budget_investments/_dossier_form.html.erb b/app/views/valuation/budget_investments/_dossier_form.html.erb index a5229234d..56460f0ed 100644 --- a/app/views/valuation/budget_investments/_dossier_form.html.erb +++ b/app/views/valuation/budget_investments/_dossier_form.html.erb @@ -47,7 +47,7 @@
    <%= f.number_field :price_first_year, - label: t("valuation.budget_investments.edit.price_first_year", currency: budget.currency_symbol), + label: t("valuation.budget_investments.edit.price_first_year", currency: budget.currency_symbol), max: 1000000000000000 %>
    From 0911b89d16a4170b94aaa085c603ffa09aeee58d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 30 Sep 2020 22:10:59 +0200 Subject: [PATCH 08/16] Add name attribute to heading content blocks This way we can simplify the code and don't have to rely on `.try` statements which are confusing and so we don't allow them in the `Rails/SafeNavigation` Rubocop rule. --- .../content_blocks_controller.rb | 2 +- app/models/budget/content_block.rb | 1 + .../content_blocks/edit.html.erb | 2 +- .../content_blocks/index.html.erb | 2 +- spec/models/budget/content_block_spec.rb | 14 ++++++++++++++ 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/site_customization/content_blocks_controller.rb b/app/controllers/admin/site_customization/content_blocks_controller.rb index ed04b85a0..a7420c5e7 100644 --- a/app/controllers/admin/site_customization/content_blocks_controller.rb +++ b/app/controllers/admin/site_customization/content_blocks_controller.rb @@ -77,7 +77,7 @@ class Admin::SiteCustomization::ContentBlocksController < Admin::SiteCustomizati if @content_block.is_a? Budget::ContentBlock @selected_content_block = "hcb_#{@content_block.heading_id}" else - @selected_content_block = @content_block.heading.name + @selected_content_block = @content_block.name end @is_heading_content_block = true render :edit diff --git a/app/models/budget/content_block.rb b/app/models/budget/content_block.rb index 06de2bd19..fef73dc9a 100644 --- a/app/models/budget/content_block.rb +++ b/app/models/budget/content_block.rb @@ -4,5 +4,6 @@ class Budget validates :heading, presence: true, uniqueness: { scope: :locale } belongs_to :heading + delegate :name, to: :heading, allow_nil: true end end diff --git a/app/views/admin/site_customization/content_blocks/edit.html.erb b/app/views/admin/site_customization/content_blocks/edit.html.erb index 6d0efd5e9..0a66bd5d5 100644 --- a/app/views/admin/site_customization/content_blocks/edit.html.erb +++ b/app/views/admin/site_customization/content_blocks/edit.html.erb @@ -1,5 +1,5 @@ <% provide :title do %> - <%= t("admin.header.title") %> - <%= t("admin.menu.site_customization.content_blocks") %> - <%= @content_block.try(:name) || @content_block.heading.try(:name) %> (<%= @content_block.locale %>) + <%= t("admin.header.title") %> - <%= t("admin.menu.site_customization.content_blocks") %> - <%= @content_block.name %> (<%= @content_block.locale %>) <% end %> <%= back_link_to admin_site_customization_content_blocks_path %> diff --git a/app/views/admin/site_customization/content_blocks/index.html.erb b/app/views/admin/site_customization/content_blocks/index.html.erb index ef069e448..d7a632709 100644 --- a/app/views/admin/site_customization/content_blocks/index.html.erb +++ b/app/views/admin/site_customization/content_blocks/index.html.erb @@ -43,7 +43,7 @@ <% end %> <% @headings_content_blocks.each do |content_block| %> - <%= link_to "#{content_block.heading.name} (#{content_block.locale})", admin_site_customization_edit_heading_content_block_path(content_block) %> + <%= link_to "#{content_block.name} (#{content_block.locale})", admin_site_customization_edit_heading_content_block_path(content_block) %> <%= raw content_block.body %> <%= render Admin::TableActionsComponent.new( diff --git a/spec/models/budget/content_block_spec.rb b/spec/models/budget/content_block_spec.rb index 68d6f0a17..e8d1e4d28 100644 --- a/spec/models/budget/content_block_spec.rb +++ b/spec/models/budget/content_block_spec.rb @@ -19,4 +19,18 @@ describe Budget::ContentBlock do heading: heading_content_block_en.heading, locale: "es") expect(valid_block).to be_valid end + + describe "#name" do + it "uses the heading name" do + block = Budget::ContentBlock.new(heading: Budget::Heading.new(name: "Central")) + + expect(block.name).to eq "Central" + end + + it "returns nil on new records without heading" do + block = Budget::ContentBlock.new + + expect(block.name).to be_nil + end + end end From 2eb255e85a0110d895f9f5d065fc1aba7b138513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 30 Sep 2020 22:34:14 +0200 Subject: [PATCH 09/16] Apply Rails/SafeNavigation rule in ERB files --- app/views/admin/budget_investments/show.html.erb | 2 +- app/views/admin/valuators/_valuator_row.html.erb | 2 +- app/views/layouts/_officing_booth.html.erb | 2 +- app/views/layouts/application.html.erb | 2 +- app/views/layouts/dashboard.html.erb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/admin/budget_investments/show.html.erb b/app/views/admin/budget_investments/show.html.erb index 7d1ceb8b5..3d209eb57 100644 --- a/app/views/admin/budget_investments/show.html.erb +++ b/app/views/admin/budget_investments/show.html.erb @@ -25,7 +25,7 @@

    <%= t("admin.budget_investments.show.classification") %>

    <%= t("admin.budget_investments.show.assigned_admin") %>: - <%= @investment.administrator.try(:name_and_email) || t("admin.budget_investments.show.undefined") %> + <%= @investment.administrator&.name_and_email || t("admin.budget_investments.show.undefined") %>

    diff --git a/app/views/admin/valuators/_valuator_row.html.erb b/app/views/admin/valuators/_valuator_row.html.erb index c85e159cd..47ff21947 100644 --- a/app/views/admin/valuators/_valuator_row.html.erb +++ b/app/views/admin/valuators/_valuator_row.html.erb @@ -10,7 +10,7 @@ <% if valuator.valuator_group.present? %> - <%= valuator.valuator_group.try(:name) %> + <%= valuator.valuator_group&.name %> <% else %> <%= t("admin.valuators.index.no_group") %> <% end %> diff --git a/app/views/layouts/_officing_booth.html.erb b/app/views/layouts/_officing_booth.html.erb index bee7e78d7..4b039584a 100644 --- a/app/views/layouts/_officing_booth.html.erb +++ b/app/views/layouts/_officing_booth.html.erb @@ -1,5 +1,5 @@ <% if current_user.poll_officer? %>

    - <%= t("admin.officing_booth.title", booth: try(:current_booth).try(:location)) %> + <%= t("admin.officing_booth.title", booth: try(:current_booth)&.location) %>
    <% end %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index f8ec90b25..dd3ad8add 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,5 +1,5 @@ - + <%= render "layouts/common_head", default_title: setting["org_name"] %> <%= render "layouts/tracking_data" %> diff --git a/app/views/layouts/dashboard.html.erb b/app/views/layouts/dashboard.html.erb index 1e6f413cc..045f061b8 100644 --- a/app/views/layouts/dashboard.html.erb +++ b/app/views/layouts/dashboard.html.erb @@ -1,5 +1,5 @@ - + From cc2aa6de6eda21294c8b3b0e21213a37155161bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 30 Sep 2020 22:35:23 +0200 Subject: [PATCH 10/16] Apply Style/TrailingCommaInHashLiteral rule in ERB --- app/views/budgets/investments/_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/budgets/investments/_form.html.erb b/app/views/budgets/investments/_form.html.erb index 2156b9d60..f00bfaab7 100644 --- a/app/views/budgets/investments/_form.html.erb +++ b/app/views/budgets/investments/_form.html.erb @@ -4,7 +4,7 @@
    - <%= f.select :heading_id, budget_heading_select_options(@budget), { include_blank: true, } %> + <%= f.select :heading_id, budget_heading_select_options(@budget), { include_blank: true } %>
    From c1cf9f0c343906fc5f58b7473b755747bcccf0ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 30 Sep 2020 22:36:58 +0200 Subject: [PATCH 11/16] Apply Style/SymbolProc rule in ERB files --- app/views/admin/hidden_users/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/hidden_users/show.html.erb b/app/views/admin/hidden_users/show.html.erb index 1d82fb301..81458cf8e 100644 --- a/app/views/admin/hidden_users/show.html.erb +++ b/app/views/admin/hidden_users/show.html.erb @@ -36,4 +36,4 @@ <% end %> -<%= paginate [@debates, @comments].sort_by { |x| x.size }.last %> +<%= paginate [@debates, @comments].sort_by(&:size).last %> From 82200c5d0beb7631c6fc4cf0d4cb8af4981f80f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 30 Sep 2020 22:37:37 +0200 Subject: [PATCH 12/16] Apply ParenthesesAsGroupedExpression rule in ERB --- app/views/admin/settings/_featured_settings_table.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/settings/_featured_settings_table.html.erb b/app/views/admin/settings/_featured_settings_table.html.erb index 75dc5938b..8936b3cae 100644 --- a/app/views/admin/settings/_featured_settings_table.html.erb +++ b/app/views/admin/settings/_featured_settings_table.html.erb @@ -21,7 +21,7 @@ <% if feature.enabled? %> - <%= t ("admin.settings.index.features.enabled") %> + <%= t("admin.settings.index.features.enabled") %> <% else %> From e7ca01fad7cfb3a22055e64ca8a05002b8f60035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 30 Sep 2020 22:46:26 +0200 Subject: [PATCH 13/16] Apply Rails/Presence rule in ERB files --- app/views/legislation/processes/_process.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/legislation/processes/_process.html.erb b/app/views/legislation/processes/_process.html.erb index 98e21d613..8919ee848 100644 --- a/app/views/legislation/processes/_process.html.erb +++ b/app/views/legislation/processes/_process.html.erb @@ -13,7 +13,7 @@
    - <%= markdown(process.summary.present? ? process.summary : first_paragraph(process.description)) %> + <%= markdown(process.summary.presence || first_paragraph(process.description)) %>
    From 1c2886debb93f10b0d0eb3ebc66fb8531b3ffb9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sun, 18 Oct 2020 13:37:34 +0200 Subject: [PATCH 14/16] Remove redundant condition The association `organization.user` returns `nil` when the user is hidden. This was discovered thanks to the `Style/AndOr` rule. We were using `and` and `||` on the same line, which is confusing. --- app/views/admin/organizations/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/organizations/index.html.erb b/app/views/admin/organizations/index.html.erb index fb1dd0a58..c320087e8 100644 --- a/app/views/admin/organizations/index.html.erb +++ b/app/views/admin/organizations/index.html.erb @@ -22,7 +22,7 @@ <% @organizations.each do |organization| %> - <% hidden += 1 and next if organization.user.nil? || organization.user.hidden? %> + <% hidden += 1 and next if organization.user.nil? %> <%= organization.name %> <%= organization.email %> From b214205d8f4778825b410fcbbe280f83922a8060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 5 Feb 2021 17:01:46 +0100 Subject: [PATCH 15/16] Use Capybara to disable animations in tests We were doing it manually, but Capybara offers an option which does the exact same thing. This way we also apply the NoJavascriptTagHelper ERB rule, which reported one error in the `disable_animations_in_tests` partial. --- .erb-lint.yml | 2 ++ app/views/layouts/_common_head.html.erb | 1 - app/views/layouts/_disable_animations_in_tests.html.erb | 8 -------- spec/rails_helper.rb | 1 + 4 files changed, 3 insertions(+), 9 deletions(-) delete mode 100644 app/views/layouts/_disable_animations_in_tests.html.erb diff --git a/.erb-lint.yml b/.erb-lint.yml index ec457aa0c..1643ea6f6 100644 --- a/.erb-lint.yml +++ b/.erb-lint.yml @@ -8,6 +8,8 @@ linters: enabled: true FinalNewline: enabled: true + NoJavascriptTagHelper: + enabled: true SelfClosingTag: enabled: false SpaceAroundErbTag: diff --git a/app/views/layouts/_common_head.html.erb b/app/views/layouts/_common_head.html.erb index f034f7baf..d4c0d4daf 100644 --- a/app/views/layouts/_common_head.html.erb +++ b/app/views/layouts/_common_head.html.erb @@ -6,4 +6,3 @@ <%= javascript_include_tag "application", "data-turbolinks-track" => "reload" %> <%= csrf_meta_tags %> <%= favicon_link_tag "favicon.ico" %> -<%= render "layouts/disable_animations_in_tests" if Rails.env.test? %> diff --git a/app/views/layouts/_disable_animations_in_tests.html.erb b/app/views/layouts/_disable_animations_in_tests.html.erb deleted file mode 100644 index e2df3fe4e..000000000 --- a/app/views/layouts/_disable_animations_in_tests.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -<%= javascript_tag "jQuery.fx.off = true" %> - diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 44e369ffa..29fc2eece 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -47,5 +47,6 @@ end Capybara.exact = true Capybara.enable_aria_label = true +Capybara.disable_animation = true OmniAuth.config.test_mode = true From 00656e2e10ed7d86416da25214cd97ae13bba8d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Mon, 8 Feb 2021 14:57:09 +0100 Subject: [PATCH 16/16] Fix SpaceAroundErbTag offense --- app/views/management/_user_permissions.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/management/_user_permissions.html.erb b/app/views/management/_user_permissions.html.erb index 44778fb3e..f083cd322 100644 --- a/app/views/management/_user_permissions.html.erb +++ b/app/views/management/_user_permissions.html.erb @@ -1,4 +1,4 @@ -<% # Parameters: +<%# # Parameters: # message: A string explaining the permissions # permissions: An array of symbols containing the permissions # (can be :debates, :proposal, :support_proposal, :votes) %>