bad_patterns(rxmatch=False,
casesens=True,
patterns=None,
fromfiles=None)
|
|
Detect unwanted patterns in text [hook factory].
Patterns can be given both as list of strings, and as a list of file
paths containing patterns (in each file: one pattern per line, strip
leading and trailing whitespace, skip empty lines, #-comments). Detected
patterns are reported to stdout.
If rxmatch is False, patterns are matched by
plain substring search, otherwise as regular expressions. If
casesens is True, matching is case sensitive.
If the message has pipe flag no-bad-patterns, check is
skipped.
- Parameters:
rxmatch (bool) - whether to take pattern as regular expression
casesens (bool) - whether the match should be case-sensitive
patterns (list of strings) - patterns to match the text
fromfiles (list of strings) - file paths from which to read patterns
- Returns:
(text, msg, cat)->numerr
- type S3A hook
|