Skip to content

Commit

Permalink
Fix erblint call on CircleCI (#4138)
Browse files Browse the repository at this point in the history
* Fix erblint call

It's not checking the correct files

* Fix erblint on Rails views

* Move erblint call to a bash file

* Use `shopt` instead of `set`
  • Loading branch information
mrcasals committed Sep 19, 2018
1 parent 94f8a84 commit 79de384
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Expand Up @@ -119,8 +119,8 @@ jobs:
name: Run rubocop
command: bundle exec rubocop
- run:
name: Run erb_lint
command: bundle exec erblint **/app/{cells,views}/**/*.erb
name: Run erblint
command: /app/.circleci/run_erblint.sh
- *store_test_results
generators:
<<: *defaults
Expand Down
7 changes: 7 additions & 0 deletions .circleci/run_erblint.sh
@@ -0,0 +1,7 @@
#!/bin/bash

shopt -s globstar

bundle exec erblint **/app/{cells,views}/**/*.erb

shopt -u globstar
Expand Up @@ -62,7 +62,7 @@
<td><%= translated_attribute(user.officialized_as) %></td>

<td class="table-list__actions">
<%= icon_link_to "envelope-closed", current_or_new_conversation_path_with(user), t("decidim.contact"), class:"action-icon--new" %>
<%= icon_link_to "envelope-closed", current_or_new_conversation_path_with(user), t("decidim.contact"), class:"action-icon--new" %>
<% if user.officialized? %>
<%= icon "circle-check", class: "action-icon action-icon--disabled" %>
<%= icon_link_to "pencil", new_officialization_path(user_id: user.id), t(".reofficialize"), class: "action-icon--new" %>
Expand Down
@@ -1,5 +1,5 @@
<%= decidim_form_for(@form, url: conference_copies_path(current_conference), method: :post, html: { class: "form copy_conference" }) do |f| %>
<%= render partial: "form", object: f, locals: { title: t("conference_copies.new.title", scope: "decidim.admin"), select: t("conference_copies.new.select", scope: "decidim.admin")} %>
<%= render partial: "form", object: f, locals: { title: t("conference_copies.new.title", scope: "decidim.admin"), select: t("conference_copies.new.select", scope: "decidim.admin") } %>

<div class="button--double form-general-submit">
<%= f.submit t("conference_copies.new.copy", scope: "decidim.admin") %>
Expand Down
Expand Up @@ -4,11 +4,11 @@
</div>
<div class="card-section">
<div class="row column hashtags__container">
<%= form.translated :text_field, :title, autofocus: true, class: "js-hashtags", hashtaggable: true, value: @meeting.present? ? present(@meeting).title : "" %>
<%= form.translated :text_field, :title, autofocus: true, class: "js-hashtags", hashtaggable: true, value: @meeting.present? ? present(@meeting).title : "" %>
</div>

<div class="row column hashtags__container">
<%= form.translated :editor, :description, class: "js-hashtags", hashtaggable: true, value: @meeting.present? ? present(@meeting).title : "" %>
<%= form.translated :editor, :description, class: "js-hashtags", hashtaggable: true, value: @meeting.present? ? present(@meeting).title : "" %>
</div>

<div class="row column">
Expand Down
Expand Up @@ -2,7 +2,7 @@
<%= render partial: "decidim/proposals/proposals/wizard_aside" %>

<div class="columns large-6">
<%= render partial: "decidim/proposals/proposals/wizard_header", locals: {callout_step_help_text_class: "warning"} %>
<%= render partial: "decidim/proposals/proposals/wizard_header", locals: { callout_step_help_text_class: "warning" } %>
<% if @similar_collaborative_drafts.presence %>
<div class="row small-up-1 card-grid">
Expand All @@ -12,7 +12,7 @@
</div>
<% end %>
<div class="row column text-center">
<%= link_to t(".mine_is_different"), complete_collaborative_drafts_path(collaborative_draft: {title: @form.title, body: @form.body}), class: "button small" %>
<%= link_to t(".mine_is_different"), complete_collaborative_drafts_path(collaborative_draft: { title: @form.title, body: @form.body }), class: "button small" %>
</div>
</div>
<div class="columns large-3"></div>
Expand Down
Expand Up @@ -116,7 +116,7 @@
<%= render partial: "decidim/shared/static_map", locals: { icon_name: "proposals", geolocalizable: @collaborative_draft } %>
<% end %>
<%= cell "decidim/tags", @collaborative_draft, context: {extra_classes: ["tags--collaborative-draft"]} %>
<%= cell "decidim/tags", @collaborative_draft, context: { extra_classes: ["tags--collaborative-draft"] } %>
</div>
</div>
</div>
Expand Down
Expand Up @@ -3,7 +3,7 @@
</div>

<div class="field hashtags__container">
<%= form.text_area :body, rows: 10, class: "js-hashtags", hashtaggable: true, value: present(@proposal).body %>
<%= form.text_area :body, rows: 10, class: "js-hashtags", hashtaggable: true, value: present(@proposal).body %>
</div>

<% if component_settings.geocoding_enabled? %>
Expand Down
Expand Up @@ -16,7 +16,7 @@
<%== cell("decidim/proposals/proposal_m", proposal).badge %>

<p><%= truncate(present(proposal).html_body, length: 100) %></p>
<%= cell "decidim/tags", proposal, context: {extra_classes: ["tags--proposal"]} %>
<%= cell "decidim/tags", proposal, context: { extra_classes: ["tags--proposal"] } %>
</div>
</article>
</div>

0 comments on commit 79de384

Please sign in to comment.