-
Notifications
You must be signed in to change notification settings - Fork 123
Description
I have a very specific use case where I would like to use custom DevSkim rules on.
I described the situation here: jqlang/jq#566 (comment) which I moved into a discussion here: jqlang/jq#3218.
For DevSkim purposes this for now can be considered a 'custom and unsupported language', JQ. JQ in itself is not valid JSON but in my use-case a large part of it is JSON. To avoid writing very complicated regular expressions on a complicated file structure only, if I enclosed it in placeholders like in below example.
{
"name": "Example",
"data": [
# __JQ_START__
.input | map({ key: .key, value: .value })
# __JQ_END__
]
}Is there a way in DevSkim to first use regex to remove everything in between the placeholders, including the placeholders itself, and then use JSONpath on the remainder, which is now fully JSON?
Or visa versa remove everything outside the placeholders including the placeholders, and do another regex on the remainder (JQ only)?