Support regex with capturing groups
rciovati opened this issue ยท 6 comments
In our modularization strategy we allow a module :features:X:Y
to depend on :features:X:Z
and I'm trying to express this relationship so that the plugin don't consider these as violations. I tried with no luck by using the following regex:
":features:(\\S*):\\S* -> :features:\\1:\\S*"
Accordingly to regex101 it should be working but perhaps I'm missing something.
Do you have any other idea on how I could express such a rule?
Hi Riccardo, thanks for reporting this.
This is not supported now, because the plugin treats the rule definition ":features:(\\S*):\\S* -> :features:\\1:\\S*"
as two separate regexes (regex1 -> regex2
), therefore there cannot be any relation for now like in your case the second regex referencing group from the first one.
Let me know if that explanation makes sense to you please.
This is possible an idea for improvement so thanks for that. By now the options are:
- Define separately exclusions for each unique
X
- Use only the
restricted
option and not themoduleLayers
one.
Thanks for using the plugin and let me know if there are more possibilities for improvement.
Hey @jraska!
Let me know if that explanation makes sense to you please.
Thank you for the clarification, it definitely makes sense ๐
By now the options are:
- Define separately exclusions for each unique X
- Use only the restricted option and not the moduleLayers one.
Cool, I'll try to think about using these options although it might be tricky with our current module structure. Ill let you know how it goes ๐
Hi Riccardo again, please check the PR #54. I think this feature might be a good improvement for more flexible modules matching.
I would appreciate one more opinion on the question if this is a breaking behaviour change, but I believe that it isn't? Details in the PR.
Thanks!
Hi, could you please give it a try to latest release? I'm curious if it now supports the features you needed. https://github.com/jraska/modules-graph-assert/releases
I also see you work at Soundcloud? Is that the project you are trying the plugin in? :)
@jraska I just tried the version 1.3.1 and your change works perfectly, thank you ๐
And for your question - yes, I'm trying the plugin in the SC app ๐
Cool, thank you for opening it I would say the feature set of the plugin is now much better with groups.
Feels good that it is used on large project :) Please let me know whenever how it goes and if it actually has the desired effect in the long run.
๐