Set Sorbet/StrictSigil
to Safe: false
#268
Merged
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.
Solves:
Basically, because this cop can make existing files un-parsable by Sorbet, the correction should not be considered fully equivalent. Per the definition, we mark the autocorrect accordingly:
The end effect of this change is that this Cop will be run in
rubocop -A
but not byrubocop -a
It will also amend the notes
.rubocop_todo.yml
to look like:# This cop supports unsafe autocorrection (--autocorrect-all).
As a large app maintainer, I recently examined our 1000 observed Rubocop rules, the 120 of them that had entries in
.rubocop_todo.yml
, and the ones that were marked safe for autocorrection.This was one of about 4 examples that were marked safe for autocorrection, and yet did not return fully equivalent code.