We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
In the following example (scaled down from real code), InstanceVariableInClassMethod's diagnostic is wrong.
$ cat struct.rb class Foo def self.new_struct Struct.new(:foo) { def bar @bar ||= 42 end }.new end end s = Foo.new_struct puts s.bar
$ bundle exec rubocop struct.rb Inspecting 1 file C Offenses: struct.rb:5:9: C: ThreadSafety/InstanceVariableInClassMethod: Avoid instance variables in class methods. @bar ||= 42 ^^^^ 1 file inspected, 1 offense detected
This is version 0.4.4.
PS/ Where is the rendered documentation? I meant, there is https://docs.rubocop.org/rubocop-rails/cops_rails.html for instance, but I could not find anything comparable for Thread Safety.
The text was updated successfully, but these errors were encountered:
Hi! Thanks for the bug report.
How would you feel about opening a pull request to start resolving this? I'm happy to support you through it.
I would start by making a new failing test case using your example code.
Sorry, something went wrong.
No branches or pull requests
Hi,
In the following example (scaled down from real code), InstanceVariableInClassMethod's diagnostic is wrong.
This is version 0.4.4.
PS/ Where is the rendered documentation? I meant, there is https://docs.rubocop.org/rubocop-rails/cops_rails.html for instance, but I could not find anything comparable for Thread Safety.
The text was updated successfully, but these errors were encountered: