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 L{WtfWarning} and L{WtfError} representation in roswtf.model.
Function | error |
Check return value of rule and update ctx if rule failed. |
Function | warning |
Check return value of rule and update ctx if rule failed. |
Function | _check |
Undocumented |
Check return value of rule and update ctx if rule failed.
@param rule: Rule/message pair. @type rule: (rule_fn, format_msg) @param ret: return value of rule. If value is non-zero, rule failed @type ret: Any @param ctx: context for which rule failed @type ctx: L{WtfContext}