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

In VSCode, rubocop linter doesn't show the Rails/HasManyOrHasOneDependent cop #713

Closed
prdetective opened this issue Mar 15, 2021 · 3 comments
Labels

Comments

@prdetective
Copy link

Your environment

  • vscode-ruby version: v0.28.1
  • Ruby version: 3.0.0p0
  • Ruby version manager (if any): rbenv
  • VS Code version: 1.54.2
  • Operating System: Mac Os 11.2.2
  • Using language server? yes

Expected behavior

I have the rubocop and rubocop-rails gems installed. .rubocop.yml file has require: rubocop-rails string. Rails cops work fine in console and in VSCode.

Creating a file:

class User < ApplicationRecord
  has_many :messages
end

If I run the rubocop from the console I see the cop as expected:

Rails/HasManyOrHasOneDependent: Specify a :dependent option.

It should warn about this in VSCode too.

Actual behavior

Linter is being run, but the line with the cop stays w/o any error indication. If I add other problematic lines, they get underlined just fine.

@prdetective
Copy link
Author

Additionally, if I try to disable this cop locally, I get the Unnecessary disabling of Rails/HasManyOrHasOneDependent. error.

@FooBarWidget
Copy link
Contributor

I think this issue is a duplicate of #227 (of which the root cause is #719).

@github-actions
Copy link

This issue has not had activity for 30 days. It will be automatically closed in 7 days.

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

No branches or pull requests

2 participants