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

Bumping sigils with rubocop comments yields invalid results #427

Closed
jakebrady5 opened this issue Aug 3, 2023 · 0 comments · Fixed by #428
Closed

Bumping sigils with rubocop comments yields invalid results #427

jakebrady5 opened this issue Aug 3, 2023 · 0 comments · Fixed by #428
Labels
bug Something isn't working

Comments

@jakebrady5
Copy link
Contributor

Describe the bug

Bumping files containing sorbet sigils with inline rubocop comments yields invalid sigils and bumps files incorrectly.

Consider sample.rb:

# typed: false # rubocop:todo Sorbet/StrictSigil

class Sample; end
Sample.method_that_does_not_exist

Executing spoom bump --from false --to true yields the following sigil:

# typed: true# rubocop:todo Sorbet/StrictSigil

Sorbet's parser treats this as an invalid sigil (playground), and will not typecheck the file.

Because there are no sorbet errors, spoom considers the file successfully bumped.

To Reproduce

Spoom version: 1.2.2

Bumping the sample file above will reproduce, and should reproduce from and to any strictness level.

Expected behavior

The whitespace between the original sigil level and subsequent text should be preserved. This will yield a valid resulting sorbet sigil and allow spoom to more accurately gauge the validity of a bump.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant