Description
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.