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

Autocorrect with rubocop #383

Open
jcoyne opened this issue Oct 16, 2024 · 2 comments
Open

Autocorrect with rubocop #383

jcoyne opened this issue Oct 16, 2024 · 2 comments

Comments

@jcoyne
Copy link

jcoyne commented Oct 16, 2024

When my config is:

---
EnableDefaultLinters: true
linters:
  ErbSafety:
    enabled: true
  Rubocop:
    enabled: true

and I run erb_lint -a it does this correction.

+++ b/app/views/blacklight/nav/_search_history.html.erb
@@ -1 +1,3 @@
-<%= link_to t('blacklight.header_links.search_history'), blacklight.search_history_path, class: 'nav-link' %>
+# frozen_string_literal: true
+link_to t('blacklight.header_links.search_history'), blacklight.search_history_path, class: 'nav-link'
+ %>

This drops the opening <%= tag.

@ashgkwd
Copy link

ashgkwd commented Nov 10, 2024

For now, I disabled Rubocop in lintrers. Once there is some solution/workaround, I'll enable it again

---
EnableDefaultLinters: true
linters:
  ErbSafety:
    enabled: true
  Rubocop:
    enabled: false # this line changed

@jbigler
Copy link

jbigler commented Dec 7, 2024

Did you try disabling some of the cops that can cause problems with ERB files?
https://github.com/Shopify/erb_lint#rubocop

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

No branches or pull requests

3 participants