Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Rubocop being run against erbs #48

Closed
baxter opened this issue Jul 2, 2015 · 21 comments
Closed

Rubocop being run against erbs #48

baxter opened this issue Jul 2, 2015 · 21 comments

Comments

@baxter
Copy link

baxter commented Jul 2, 2015

Recently I've started experiencing a problem where linter-rubocop runs rubocop against erb files.

Running rubocop from the command line, erb files are skipped as expected.

Is this a known problem? If so is there any workaround for it? I tried adding app/views to the list of excluded files, but I suspect rubocop ignores this when linter-rubocop passes in the filename explicitly.

Thanks,

Paul.

@SxDx
Copy link

SxDx commented Jul 9, 2015

I also have this Problem but I'm not sure which update introduced it.

@jensljungblad
Copy link

Have this as well. Is it possible to work around until a fix is made available?

@aar0nr
Copy link

aar0nr commented Jul 10, 2015

A workaround is to switch the language of the file to HTML (Rails) instead of HTML (Ruby - ERB), and then reopen the file.

@project0
Copy link

seems to be an problem with the language-ruby plugin.
same problem like in linter-ruby. AtomLinter/linter-ruby#26

@nickpoorman

This comment has been minimized.

@Arcanemagus
Copy link
Member

As mentioned over in AtomLinter/linter-ruby#26 this is a bug in language-ruby, you can try installing language-ruby-on-rails which properly marks embedded ruby code as source.embedded.ruby, which this plugin (correctly) does not mark itself as being able to handle.

I'm marking this as closed since this isn't an issue that can or should be fixed here.

@Arcanemagus
Copy link
Member

Filed an issue over there as it seems nobody had bothered to yet 😉.

@rutgerfarry
Copy link

@Arcanemagus could this issue be opened again until it's fixed? It seems the requested scope changes were made in atom/language-ruby#114, but the linter still attempts to run against .html.erb files

@Arcanemagus
Copy link
Member

@rutgerfarry This issue has been fixed since Atom v1.4.0-beta0. If you are still experiencing this can you file a new issue with the scopes you are seeing when you run Editor: Log Cursor Scopes?

lewispb added a commit to DEFRA/dst-guides that referenced this issue Sep 15, 2016
Previously, due to an issue with Rubocop we had to manually exclude
*.html.erb files from linting. That's been fixed now so we can remove
this exclusion.

AtomLinter/linter-rubocop#48
@vzamanillo
Copy link
Contributor

I am experiencing this issue, first time, after upgrading Atom

Software versions:

Ubuntu 18.10
language-ruby: 0.72.14
language-ruby-on-rails: 0.25.3
linter-ruby: 1.2.6
linter-rubocop: 2.2.3
Rubocop: 0.60.0
Atom: 1.32.2

.rubocop.yml

AllCops:
  TargetRubyVersion: 2.3

Metrics/LineLength:
  Max: 100

Style/AsciiComments:
  Enabled: false

@RonaldDijkstra
Copy link

Me too!

@PetrKaleta
Copy link

Same here, happening again with:

Atom 1.33.0
linter 2.2.0
linter-rubocop 2.2.3
language-ruby 0.72.14
language-ruby-on-rails 0.25.3

@vdhpieter
Copy link

Same here:

Atom 1.33.0
linter 2.2.0
linter-erb 1.1.1
linter-rubocop 2.2.3
linter-ruby 1.2.6
language-ruby 0.72.14
language-ruby-on-rails 0.25.3

Can you reopen this issue?

@meap

This comment has been minimized.

@RonaldDijkstra
Copy link

AllCops:
  Exclude:
    - "**/*.erb"

Putting this in .rubocop.yml fixed this issue for me.

@vdhpieter
Copy link

@RonaldDijkstra for me not really option as I share my config with my team :-(

@vdhpieter
Copy link

vdhpieter commented Dec 12, 2018

I dug a bit deeper here and found that it is broken because of a rubocop update related to this issue rubocop/rubocop#4666. It breaks on rubocop 0.56.0

@vdhpieter
Copy link

I think what happened here is that this line prevented rubocop from parsing a .erb file in the old versions:

command.push('--stdin', filePath)

But after the change the value of the -stdin does not have an effect anymore. So the real issue here is the same as before I guess to make sure a .erb file is not marked as a ruby file

andreas-venturini added a commit to denkungsart/configuration that referenced this issue Mar 5, 2019
This produces annoying errors in erb templates in Atom,
see AtomLinter/linter-rubocop#48
@ahukkanen
Copy link

Same thing happening here.

This provides a remediation but does not fix the underlying issue:
#48 (comment)

jamesjoshuahill added a commit to jamesjoshuahill/setup-mac that referenced this issue Dec 2, 2019
This causes linter-rubocop to run against ERB files, see
AtomLinter/linter-rubocop#48

Use language-ruby-on-rails plugin instead
@amerov
Copy link

amerov commented Aug 3, 2020

it happens again 😿
atom-linter-erb

@tony-rowan
Copy link

AllCops:
  Exclude:
    - "**/*.erb"

Putting this in .rubocop.yml fixed this issue for me.

for me not really option as I share my config with my team :-(

You can add it to a personal config file at $HOME/.rubocop.yml that way it won't conflict with your project / team. Not a perfect solution but it's workable work around.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests