You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'd like to add an option to configure the comment directives (rubocop:disable Foo).
I've just submitted a PR to standardrb that monkey patches CommentConfig.
Describe the solution you'd like
Add a new configuration, something like:
# The identifier used for comment directives to enable/disable RuboCop rules.
# I.e. rubocop:disable Layout/LineLength.
CommentDirectiveIdentifier: rubocop
Change CommentConfig::COMMENT_DIRECTIVE_REGEXP into a (memoized) class method that reads the indentifier.
I had a quick go at implementing it but I'm not sure how I should go about accessing ConfigStore, any hints would be appreciated.
Describe alternatives you've considered
Monkey patching is the only alternative I've considered. It's not ideal because it would be easily broken during RuboCop upgrades.
I'm guessing you want standardrb to use different prefix for those, but consider the following - this way you'd break interop between people who are using RuboCop and standard on the same project (without using similar configs).
Yeah, sorry, I should have started with why. It's as you guessed though, I'd like to change the comment directive to standardrb to make it feel more natural.
but consider the following - this way you'd break interop between people who are using RuboCop and standard on the same project (without using similar configs).
Ideally you wouldn't have RuboCop set up to cover the same rules as standardrb, so you could just use the relevant comment directive for where the rule is coming from. The downside to that is it could be confusing. Although on the flip side I tried using standardrb:disable recently hoping it would just work.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!
Is your feature request related to a problem? Please describe.
I'd like to add an option to configure the comment directives (
rubocop:disable Foo
).I've just submitted a PR to standardrb that monkey patches
CommentConfig
.Describe the solution you'd like
Add a new configuration, something like:
Change
CommentConfig::COMMENT_DIRECTIVE_REGEXP
into a (memoized) class method that reads the indentifier.I had a quick go at implementing it but I'm not sure how I should go about accessing
ConfigStore
, any hints would be appreciated.Describe alternatives you've considered
Monkey patching is the only alternative I've considered. It's not ideal because it would be easily broken during RuboCop upgrades.
Additional context
The text was updated successfully, but these errors were encountered: