PPROLint

Operators

Every comparison operator, the types it accepts and when it holds.

A comparison is { "field": <path>, "operator": <operator>, "value": <value> }. Types are checked when the rule loads.

OperatorField typeValueHolds when
equalsanysame type as the fieldthe values are equal
notEqualsanysame type as the fieldthe values differ
greaterThannumbernumberfield > value
greaterThanOrEqualnumbernumberfield ≥ value
lessThannumbernumberfield < value
lessThanOrEqualnumbernumberfield ≤ value
betweennumber[min, max]min ≤ field ≤ max, bounds included
innumber or stringa list, or a list optionthe field is one of the list
notInnumber or stringa list, or a list optionthe field is none of the list
containsstringstringthe field contains the value, case-sensitive
notContainsstringstringthe field does not contain the value
matchesstringa regular expression, as a literal stringthe pattern matches somewhere in the field
existsanynonethe field is known
notExistsanynonethe field is unknown

Every operator except exists and notExists is false when the field or the value is unknown. See Unknown values.

Values

  • A literal: 120, "video", true, a list ["mov", "mxf"] for in / notIn, a pair [50, 150] for between.
  • A field reference: { "field": "options.max" } or { "field": "sequence.inPoint" }, compared with the field's value for the same item.
  • Infinity: JSON has none; write the strings "Infinity" and "-Infinity" where a number is expected.

Regular expressions

matches takes a JavaScript regular expression with the u flag, as a literal string; it cannot refer to a field. It matches anywhere in the value: anchor it with ^ and $ to match the whole value. Backslashes are doubled in JSON: "^Chapter \\d+$".

On this page