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
Upgrade regexp_parser to 2.0 #9102
Conversation
Methods we use that used to return byte-based indices now return char-based indices, so we can revert the changes made in rubocop#8989. https://github.com/ammar/regexp_parser/blob/master/CHANGELOG.md#200---2020-11-25---janosch-m%C3%BCller
73adc65
to
9b90cae
Compare
I was just investigating this too. Thank you for the early catching up and fixing! |
Great news, thanks! |
This is not a good change. It breaks compatibility with other important gems such as |
Sorry about your troubles.
|
Update: capybara master is already updated, just not released yet. |
Thanks for looking into this. It's nice to see Capybara is using RuboCop as well. :-) |
Follow rubocop#9154, rubocop#9155, and rubocop#9102. This is a step towards the widespread use of regexp_parser 2.0. RuboCop core accepts regexp_parser 1.8, but several code is already incompatible with regexp_parser 1.8. It can cause issue because these combination of versions. Therefore, this PR ports code for regexp_parser 1.8 that will never be maintained from rubocop#9102. Implementation of this patch, code is intentionally duplicated because it is evaluated only when the class is defined. Also, since obsoleted code for regexp_parser 1.8 is assumed to never be maintained, the target to be removed is clear. To be honest, it's ugly as implementation, but I think it has the least impact for RuboCop 1.x series users.
Follow #9154, #9155, and #9102. This is a step towards the widespread use of regexp_parser 2.0. RuboCop core accepts regexp_parser 1.8, but several code is already incompatible with regexp_parser 1.8. It can cause issue because these combination of versions. Therefore, this PR ports code for regexp_parser 1.8 that will never be maintained from #9102. Implementation of this patch, code is intentionally duplicated because it is evaluated only when the class is defined. Also, since obsoleted code for regexp_parser 1.8 is assumed to never be maintained, the target to be removed is clear. To be honest, it's ugly as implementation, but I think it has the least impact for RuboCop 1.x series users.
@marcandre Thanks for the changes! I missed that commit. |
regexp_parser 2.0 is out, which introduced char-based indices we wanted.
ammar/regexp_parser#72
ammar/regexp_parser#73
Methods we use that used to return byte-based indices now return char-based indices, so we can revert the changes made in #8989.
https://github.com/ammar/regexp_parser/blob/master/CHANGELOG.md#200---2020-11-25---janosch-m%C3%BCller
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and runs RuboCop on its own code.{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.