Structural search support for filter repo:contains
Created by: jensim
Feature request description
repo:contains(file:java$ content:@:[[_]]Mapping patternType:structural) type:repo
Is your feature request related to a problem? If so, please describe.
I'm always frustrated when writing RegExp, cursing and wishing i was able to use the structural search instead..
Describe alternatives you've considered.
Regexp covers most simple cases, but structural search does everything better.
Additional context
Having comby match rules defined in the the filter would also improve the usefulness a lot.
This would help me find repos with patterns between files, like this case:
I have a suite of a few hundred applications built using maven, that have grown up over the last 10 years. And there's been poor use of maven properties in combination with an abundance of maven submodules everywhere. Where versions are declared in a root project properties block, and then consumed in a submodule. This causes modern upgrade mechanics like renovate to be unable to upgrade such versions using regular mvn versions:update-properties
.
my-parent
├─ pom.xml
└─ applications
├─ pom.xml
└─ my-application
└─ pom.xml
I would like to be able to search for these using structural search something like this
# Find the root pom with a hole for a property declaration, hole will match
repo:contains(file:^pom.xml$ content:<properties>:[_]<:[propName~[^>]+]>:[_]</properties>
# Match a pom.xml that is not in the root
file:/pom.xml$
# Match a version declaration using property
<version>${:[verName~[^}]+]}</dependency>
# Make sure the property is not also declared here
not <:[propName2~[^>]+]>
# rule match that all are the same
rule:'where :[verName] == :[propName2] && :[propName2] == :[propName]'