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

Add ragexp_dot? method to RuboCop::AST::Token. #235

Merged
merged 2 commits into from Jul 9, 2022

Conversation

koic
Copy link
Member

@koic koic commented Jul 9, 2022

Follow up #rubocop/rubocop#10798.

This PR adds ragexp_dot? method to RuboCop::AST::Token.

Follow up #rubocop/rubocop#10798.

This PR adds `ragexp_dot?` method to `RuboCop::AST::Token`.
@bbatsov
Copy link
Contributor

bbatsov commented Jul 9, 2022

You've got a typo in the commit message - ragex -> regex.

@marcandre marcandre merged commit d7d425c into rubocop:master Jul 9, 2022
@marcandre
Copy link
Contributor

Thanks @koic .
I fixed the typo

@marcandre
Copy link
Contributor

Released 1.19.0, thanks!

@koic koic deleted the add_regexp_dot_p_to_token branch July 9, 2022 19:33
@koic
Copy link
Member Author

koic commented Jul 10, 2022

@marcandre @bbatsov Thank you!

@koic
Copy link
Member Author

koic commented Jul 10, 2022

regexp_dots (not regexp_dot) may have been a more better name for this published API, but my awakening was a bit slower 💦

@marcandre
Copy link
Contributor

True. Should we rename it? We could add an alias for compatibility, but I'm fine with releasing an updated version with just the corrected name.

@koic
Copy link
Member Author

koic commented Jul 10, 2022

Yeah, I think it's widely not used yet, so I think it's an acceptable breaking change. I will open a PR.
There is a very strong probability that only my rubocop/rubocop#10803 is using it 😅

koic added a commit to koic/rubocop-ast that referenced this pull request Jul 10, 2022
…xp_dots`

Follow up rubocop#235 (comment).

This PR renames `RuboCop::AST::Token#regexp_dot?` to `RuboCop::AST::Token#regexp_dots`
It's been determined that it doesn't need to be an alias because it's the API that
has just been released and isn't widespread.
koic added a commit to koic/rubocop-ast that referenced this pull request Jul 10, 2022
…xp_dots`

Follow up rubocop#235 (comment).

This PR renames `RuboCop::AST::Token#regexp_dot?` to `RuboCop::AST::Token#regexp_dots`.
It's been determined that it doesn't need to be an alias because it's the API that
has just been released and isn't widespread.
@koic
Copy link
Member Author

koic commented Jul 10, 2022

I've just opened #236.

marcandre pushed a commit that referenced this pull request Jul 10, 2022
…xp_dots`

Follow up #235 (comment).

This PR renames `RuboCop::AST::Token#regexp_dot?` to `RuboCop::AST::Token#regexp_dots`.
It's been determined that it doesn't need to be an alias because it's the API that
has just been released and isn't widespread.
koic added a commit to koic/rubocop that referenced this pull request Jul 11, 2022
Follow up rubocop/rubocop-ast#235.

This PR uses `RuboCop::AST::Token#regexp_dots?` instead of a custom logic.

Also, `range_nodes` is only needed for autocorrection, so it's not needed most of the time.
Therefore, the timing to calculate `range_nodes` is adjusted from `on_new_investigation` to
memoization in the autocorrection logic by this PR.
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.

None yet

3 participants