Module rules
source code
Common library for writing rule-style checks for generating warnings
and errors. Use of this style streamlines reporting.
The pattern for rules is simple: a rule provides a function that
implements the rule and a format string. If the function returns a
non-zero value, that value is combined with the format string to produced
an error reporting string. There are other conveniences as well. If the
rule returns a list or a tuple, that will be transformed into a
human-readable list.
This library is a layer on top of the base WtfWarning and
WtfError
representation in roswtf.model.
Check return value of rule and update ctx if rule failed.
- Parameters:
rule ((rule_fn, format_msg)) - Rule/message pair.
ret - return value of rule. If value is non-zero, rule failed
ret - Any
ctx - context for which rule failed
ctx - WtfContext
|
Check return value of rule and update ctx if rule failed.
- Parameters:
rule ((rule_fn, format_msg)) - Rule/message pair.
ret (Any) - return value of rule. If value is non-zero, rule failed
ctx (WtfContext) - context for which rule failed
|