Passed
Push — master ( dbd4af...e9c47c )
by Jan
02:33 queued 11s
created

template.preprocess()   A

Complexity

Conditions 3

Size

Total Lines 8
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 7
nop 2
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
def preprocess(data, lang):
2
    sebool_bool = data.get("sebool_bool", None)
3
    if sebool_bool is not None and sebool_bool not in ["true", "false"]:
4
        raise ValueError(
5
            "ERROR: key sebool_bool in rule {0} contains forbidden "
6
            "value '{1}'.".format(data["_rule_id"], sebool_bool)
7
        )
8
    return data
9