Skip to content
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

Set Sorbet/StrictSigil to Safe: false #268

Merged

Conversation

corsonknowles
Copy link
Contributor

@corsonknowles corsonknowles commented Nov 14, 2024

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:

SafeAutoCorrect (true/false) - indicates whether the auto-correct a cop does is safe (equivalent) by design.

The end effect of this change is that this Cop will be run in rubocop -A but not by rubocop -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.

@corsonknowles corsonknowles requested a review from a team as a code owner November 14, 2024 22:03
@corsonknowles corsonknowles force-pushed the strict_sigil_safety_declaration branch from 88bca35 to 301e6e0 Compare November 14, 2024 22:12
Copy link
Contributor

@KaanOzkan KaanOzkan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires doc update

@corsonknowles corsonknowles force-pushed the strict_sigil_safety_declaration branch 4 times, most recently from 42f8d46 to b4de8e0 Compare November 16, 2024 03:44
@corsonknowles corsonknowles force-pushed the strict_sigil_safety_declaration branch from b4de8e0 to 92c7457 Compare November 16, 2024 03:46
@corsonknowles corsonknowles changed the title Set Sorbet/StrictSigil to SafeAutoCorrect: false Set Sorbet/StrictSigil to Safe: false Nov 16, 2024
@egiurleo egiurleo merged commit eef0497 into Shopify:main Nov 18, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants