Documentation
¶
Overview ¶
Command scrubcheck is a one-time verification: it finds the words in words.txt in the shipped surfaces.
scrubcheck [-root dir] [-words file] [-exceptions file] [-archive path]...
Surfaces: every file git tracks under -root (default "."), which covers source, docs, the plugin package, scripts and workflows (a tracked symlink is followed and its target scanned under the symlink's path; a dangling one is an error), plus each -archive (repeatable): a release archive (.tar.gz, .tgz, .tar or .zip) whose members are scanned one by one, or, for any other extension, a plain file such as a bare release binary. The tool's own directory, scripts/scrubcheck/, is scanned like any other: the scrub-list words it must name (the list itself) are covered by pattern exceptions, never by a directory-wide skip.
A word matches case-insensitively and as a whole word: a run of letters and digits (so a hyphen, an underscore or any other character is a boundary) equal to a listed word, or to a listed word plus "s". A listed word glued to other letters ("xalpha", "alphasman" for a listed "alpha") does not match. Plurals are generated, not listed.
Output, on stdout, one line per hit, sorted by file, then line, then column:
file:line:word word is lowercased; a hit in a member reads archive.tgz!member/path:line:word
file:strings:word a file with a NUL byte in its first 8000 bytes is binary and is scanned as its printable
strings (runs of at least four bytes that are printable ASCII or non-ASCII, so UTF-8 letters stay
part of a word), which have no line number
exceptions.tsv holds tab-separated path, pattern and reason. The path is a literal file path as printed (for a member, archive!member); a directory ("/" suffix) or a glob (* ? [) is rejected. The pattern is a literal substring; it covers a hit only when the hit's own occurrence lies inside an occurrence of the pattern on that line (or printable run), so a pattern "quoted alpha" excepts that one occurrence of a listed "alpha" and nothing else on the line. A pattern may contain \xHH escapes (two hex digits, either case), decoded before matching, so an entry can name a scrub-list word without containing it: write the first letter as \x68 and the exceptions file holds no whole word. A backslash not followed by x and two hex digits is literal. The reason is required. An entry that matches no hit is reported, so a stale entry cannot linger. Problems print as exceptions.tsv:LINE: message. A missing exceptions file means no exceptions.
The last line is the summary "N hits, M excepted, K exception problems". Exit 0: nothing to report. Exit 1: an unexcepted hit or an exception problem. Exit 2: usage (including a stray positional argument) or an unreadable input.