You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I already have a PoC project with the regexp_parser gem. https://github.com/pocke/rubocop-regular_expression
Now it has only one cop, it is RegularExpression/MixedCaptureTypes cop. The cop warns if a Regexp literal has both of named/numbered captures. Because we cannot reference numbered captures if they are mixed.
And I like the first option, that merging the cops to RuboCop core.
Because the cops are useful for every RuboCop users. Regexp is used in most projects. So I think RuboCop provides the cops by default.
But the second option has an advantage. We can keep fewer dependencies of RuboCop core by separating the cops as a RuboCop plugin. Because the cops need regexp_parser gem.
But personally I think it is a small advantage.
So, I propose merging the cops to RuboCop core.
If the core team agrees with the proposal, I will merge the cop to this repository, and transfer the issues of other cop ideas.
The text was updated successfully, but these errors were encountered:
And I like the first option, that merging the cops to RuboCop core.
Because the cops are useful for every RuboCop users. Regexp is used in most projects. So I think RuboCop provides the cops by default.
I prefer this option as well.
pocke
added a commit
to pocke/rubocop
that referenced
this issue
Feb 23, 2020
RuboCop will get more power with parsing Regexp literals.
We can introduce https://github.com/ammar/regexp_parser to parse Regexp.
PoC
I already have a PoC project with the regexp_parser gem.
https://github.com/pocke/rubocop-regular_expression
Now it has only one cop, it is
RegularExpression/MixedCaptureTypes
cop. The cop warns if a Regexp literal has both of named/numbered captures. Because we cannot reference numbered captures if they are mixed.And I also have other two cop ideas.
pocke/rubocop-regular_expression#1
pocke/rubocop-regular_expression#3
How release it?
I think we have two options to release the cops.
And I like the first option, that merging the cops to RuboCop core.
Because the cops are useful for every RuboCop users. Regexp is used in most projects. So I think RuboCop provides the cops by default.
But the second option has an advantage. We can keep fewer dependencies of RuboCop core by separating the cops as a RuboCop plugin. Because the cops need regexp_parser gem.
But personally I think it is a small advantage.
So, I propose merging the cops to RuboCop core.
If the core team agrees with the proposal, I will merge the cop to this repository, and transfer the issues of other cop ideas.
The text was updated successfully, but these errors were encountered: