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

Rails/ContentTag makes rubocop crashes #546

Closed
ngouy opened this issue Sep 13, 2021 · 2 comments · Fixed by #549
Closed

Rails/ContentTag makes rubocop crashes #546

ngouy opened this issue Sep 13, 2021 · 2 comments · Fixed by #549
Labels
bug Something isn't working

Comments

@ngouy
Copy link
Contributor

ngouy commented Sep 13, 2021

With this new version, I have issues with rubocop running on a pure ruby (no HTML or whatsoever) file that plays with act_as_taggable (code contains some .tag calls tag_something etc ...

An error occurred while Rails/ContentTag cop was inspecting /Users/nathangouy/Work/**************/app/models/concerns/tenant_tagging.rb

Bugs on these 2 lines:

image
image

Originally posted by @ngouy in #260 (comment)

rubocop -V :

1.20.0 (using Parser 3.0.2.0, rubocop-ast 1.11.0, running on ruby 2.7.2 x86_64-darwin20)
  - rubocop-faker 1.1.0
  - rubocop-performance 1.11.5
  - rubocop-rails 2.12.2
@koic koic added the bug Something isn't working label Sep 14, 2021
koic added a commit to koic/rubocop-rails that referenced this issue Sep 14, 2021
Fixes rubocop#546

This PR excludes `app/models` by default for `Rails/ContentTag`.
Because it prevents false positives for `tag` calls to `has_one: tag`.
No helpers are used in normal models.
@koic
Copy link
Member

koic commented Sep 14, 2021

This issue is a dup with #543. But this issue also suggests that it contains different false positives. I've opened #549.

koic added a commit to koic/rubocop-rails that referenced this issue Sep 14, 2021
Fixes rubocop#546

This PR excludes `app/models` by default for `Rails/ContentTag`.
Because it prevents false positives for `tag` calls to `has_one: tag`.
No helpers are used in normal models.
@koic koic closed this as completed in #549 Sep 14, 2021
koic added a commit that referenced this issue Sep 14, 2021
…_content_tag

[Fix #546] Exclude `app/models` by default for `Rails/ContentTag`
@ngouy
Copy link
Contributor Author

ngouy commented Sep 17, 2021

THanks a lot @koic 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants