-
Notifications
You must be signed in to change notification settings - Fork 47
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
Include thread-safety rubocop #703
base: main
Are you sure you want to change the base?
Conversation
3999c6e
to
5ab601c
Compare
test/fixtures/full_config.yml
Outdated
ThreadSafety/NewThread: | ||
Description: Avoid starting new threads. Let a framework like Sidekiq handle the | ||
threads. | ||
Enabled: true |
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 should not be enabled
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.
Right, we are not enabling it on SFR too. I will disable it 👍
test/fixtures/full_config.yml
Outdated
Enabled: true | ||
ThreadSafety/MutableClassInstanceVariable: | ||
Description: Do not assign mutable objects to class instance variables. | ||
Enabled: true |
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 cop is disallowing:
class FooTest < ActiveSupport::TestCase
setup do
@something = { a: "A" }
end
end
Which doesn't have any thread safety issue.
We need to fix that in order to enable it.
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.
I will not enable it yet. Good check, lets socialize how we can fix it 👍
4c2b934
to
3cd22cb
Compare
c04fc7a
to
a69842b
Compare
The unknown cop issue is fixed, but now we have the issue that |
Simply bumping it doesn't work either, as it breaks some assumptions made by the tooling that ensures version compatibility. We'll have to fix that too. |
Include
thread_safety
rubocop as part of Shopify style rubocop. This PR only enables the small subset of the rules as a starting point.Note that this is part of Falcon on SFR effort (vault project here).