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
Detect class_variable_set in Style/ClassVars #8211
Conversation
f7ecbbd
to
ae313d5
Compare
Can you add this bad case to the example code? |
ae313d5
to
8863bd7
Compare
fa3f156
to
4d03ccb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. Can you rebase with the latest master branch for resolve changelog entry?
4d03ccb
to
4d4a6f1
Compare
Thanks for the review @koic. Rebased from master now. Looks like the Changelog has somehow ended up with two |
Yeah, "Changes" section has been merged on the master branch. |
4d4a6f1
to
ae083eb
Compare
Ah thanks. Now I see why it didn't get thrown up as a conflict. That changelog entry should be right now. |
Thanks 👍 |
class_variable_set(:@@name, 2)
has the same effect as@@name = 2
This variation can be within the class definition:
Or it could be called elsewhere, with the class as receiver:
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and RuboCop for itself, and generates the documentation.