Skip to content

Commit 96c6180

Browse files
committed
apply suggestions
1 parent a7ca279 commit 96c6180

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

rule_schema_v1.yaml

+21-8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ $schema: http://json-schema.org/draft-07/schema#
66
#!!If you add new syntax to this file, you probably need to add some EXPERIMENTAL
77
# comment before!!
88
$defs:
9+
# EXPERIMENTAL
910
new-pattern:
1011
title: "Return finding where code matches against the following pattern"
1112
oneOf:
@@ -14,8 +15,8 @@ $defs:
1415
oneOf:
1516
- required: [ pattern ]
1617
- required: [ regex ]
17-
- required: [ and ]
18-
- required: [ or ]
18+
- required: [ all ]
19+
- required: [ any ]
1920
- required: [ not ]
2021
- required: [ inside ]
2122
- required: [ taint ]
@@ -24,12 +25,12 @@ $defs:
2425
type: string
2526
regex:
2627
type: string
27-
and:
28+
all:
2829
type: array
2930
minItems: 1
3031
items:
3132
$ref: "#/$defs/new-pattern"
32-
or:
33+
any:
3334
type: array
3435
minItems: 1
3536
items:
@@ -99,10 +100,12 @@ $defs:
99100
oneOf:
100101
- type: string
101102
# This is scuffed, but it seems that `allOf` does not short circuit.
102-
# This schema can potentially run on things which are not objects (such as lists), and if that happens,
103-
# the validator will crash when it checks the keys of the object.
104-
# I would normally just use `allOf`, but since it doensn't short circuit, I had to instead make it this
105-
# weird `if-then-else` thing to properly skip the keys check on a non-object.
103+
# This schema can potentially run on things which are not objects
104+
# (such as lists), and if that happens, the validator will crash when
105+
# it checks the keys of the object.
106+
# I would normally just use `allOf`, but since it doensn't short circuit,
107+
# I had to instead make it this weird `if-then-else` thing to properly
108+
# skip the keys check on a non-object.
106109
- if:
107110
type: object
108111
then:
@@ -723,8 +726,10 @@ properties:
723726
# EXPERIMENTAL
724727
r2c-internal-project-depends-on:
725728
$ref: "#/$defs/r2c-internal-project-depends-on-content"
729+
# EXPERIMENTAL
726730
match:
727731
$ref: "#/$defs/new-pattern"
732+
# EXPERIMENTAL
728733
extract:
729734
title: Metavariable whose content to use as the extracted result for subsequent rules
730735
type: string
@@ -808,6 +813,14 @@ properties:
808813
extract: false
809814
dest-language: false
810815
reduce: false
816+
patterns: false
817+
pattern: false
818+
pattern-either: false
819+
pattern-regex: false
820+
pattern-sinks: false
821+
pattern-sources: false
822+
pattern-propagators: false
823+
pattern-sanitizers: false
811824
match: false
812825
- if:
813826
properties:

0 commit comments

Comments
 (0)