How should we match the configuration values? #4257
Replies: 5 comments
-
I have written a post in another thread concerning this topic.
All in all, you trade freedom and flexibility for consistency. |
Beta Was this translation helpful? Give feedback.
-
I don't think so. With regular expressions you can only describe regular languages according to the Chomsky hierarchy. |
Beta Was this translation helpful? Give feedback.
-
I'd be for this as the default. If a user needs more fine-grained control, they can still create a custom rule that maps the same behavior but uses the full Regex mechanism. The benefit is that default values are easier to read and to manipulate for the vast majority of our users. |
Beta Was this translation helpful? Give feedback.
-
This issue is stale because it has been open 90 days with no activity. Please comment or this will be closed in 7 days. |
Beta Was this translation helpful? Give feedback.
-
Should this be moved to a "Discussion"? |
Beta Was this translation helpful? Give feedback.
-
Expected Behavior
All the matchings with packages, fully qualified names, class names, imports... that we provide in the configuration file follows some kind of rule.
Observed Behavior
Right now there are a lot of behaviours and they are not documented so it's kind of difficult to know which is the behaviour.
Context
I saw this problem when I refactor the string list in yaml arrays. In some places we use a "contains" in other places an "endsWith", in other places we use
glob
and in others we use full regex.In my opinion we can reduce all our needs in two different options:
.
. I think that these should be the default option.Options that we don't need:
glob
. You just need to scape*
and?
and they are not used too much in fully qualified names or similar.glob
because you just need to add a*
at the beggining and/or the end.An example of this can be found here: #2698
Beta Was this translation helpful? Give feedback.
All reactions