Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
memo) In this case, it is pointless to enable this cop because it is not always an offense. Should we occur warning or runtime error for this setting? WDYT? @rubocop/rubocop-rspec
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 don’t understand. Do you mean it’s not deterministic?
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.
The following checks are always considered non-offenses:
rubocop-rspec/lib/rubocop/cop/rspec/context_wording.rb
Line 88 in 7592cec
This Cop sets valid wording in
Prefixes
andAllowedPatterns
, but it always dose not occur offenses if there is no valid wording setting. I don't think that's the intended setting, but users have no way of knowing right now. Because it's always dose not occur offenses.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, with these settings, there will be no offenses, regardless of what is or is not in the Context. It is always not an offense. (I'm not attached to it staying that way).
I looked at the Obsoletion setup recently, and I think it raises runtime errors with the expectation that the user will want to fix those issues. That feels similar to how a user may want to fix the config or disable this cop instead of letting it run "on empty"
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.
It’s an unlikely combination of settings, so unless it’s very simple to implement, I don‘t think we need to warn our users about 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.
If the
Prefixes
andAllowedPatterns
are empty to begin with, there is no allowed Wording, so it might be better to make them all violations. That way, users would notice the misconfiguration and it would not be too difficult to implement.