Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erb lint update #1782

Merged
merged 4 commits into from
Sep 4, 2024
Merged

Erb lint update #1782

merged 4 commits into from
Sep 4, 2024

Conversation

ellohez
Copy link
Contributor

@ellohez ellohez commented Sep 2, 2024

Currently in most(may be all) of our app there is no linting mechanism for erb files. We want some way of linting erb files and hence we have introduced erb_lint gem for the same.

The changes in this PR allows us to have a workflow to run erb lint.
All the files that have been linted after running erblint.

When we run the command 'erblint --lint-all' it uses the default '.erb_lint.yml' file inside the project to apply any custom rules.

https://trello.com/c/NPZL0Ibg

@@ -19,7 +19,7 @@
<% end %>

<h4>
<%= link_to content_item.title, content_item.url, data: {proxy_iframe: 'enabled', modal_url: content_item.proxied_url, toggle: 'modal', target: '#iframe_modal_id'} %>
<%= link_to content_item.title, content_item.url, data: {proxy_iframe: "enabled", modal_url: content_item.proxied_url, toggle: "modal", target: "#iframe_modal_id"} %>

Check notice

Code scanning / Brakeman

Potentially unsafe model attribute in link_to href. Note

Potentially unsafe model attribute in link\_to href.
Copy link

@syed-ali-tw syed-ali-tw Sep 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we can dismiss this brakeman alert here as its not caused by lint changes and ignore later.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's what the update to the brakeman.ignore fils is supposed to achieve?

@ellohez ellohez marked this pull request as draft September 2, 2024 12:46
Line only updated for erb linting
Safe to still ignore
@ellohez ellohez closed this Sep 3, 2024
@ellohez ellohez reopened this Sep 3, 2024
@ellohez ellohez marked this pull request as ready for review September 3, 2024 16:10
Copy link
Contributor

@mtaylorgds mtaylorgds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of minor comments, and it looks like brakeman still isn't happy…

Gemfile Outdated Show resolved Hide resolved
app/views/tag_migrations/show.html.erb Outdated Show resolved Hide resolved
Correct indendation issue from linting
Make Gem require: false
Brakeman ignore file updated
Copy link
Contributor

@mtaylorgds mtaylorgds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ellohez ellohez merged commit 7fa691e into main Sep 4, 2024
10 checks passed
@ellohez ellohez deleted the erb-lint-update branch September 4, 2024 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants