Mercurial > hg
comparison contrib/check-code.py @ 27693:2b9126d6588b
check-code: allow only-whitespace lines in tests
These turn out to be necessary to embed diffs with blank lines in test
input. So we now complain about whitespace following a character.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 08 Jan 2016 12:35:02 -0600 |
parents | 8d0a09162d0f |
children | 0029c2bebc23 |
comparison
equal
deleted
inserted
replaced
27692:e0465035def9 | 27693:2b9126d6588b |
---|---|
146 | 146 |
147 winglobmsg = "use (glob) to match Windows paths too" | 147 winglobmsg = "use (glob) to match Windows paths too" |
148 uprefix = r"^ \$ " | 148 uprefix = r"^ \$ " |
149 utestpats = [ | 149 utestpats = [ |
150 [ | 150 [ |
151 (r'^(\S.*|| [$>] .*)[ \t]\n', "trailing whitespace on non-output"), | 151 (r'^(\S.*|| [$>] \S.*)[ \t]\n', "trailing whitespace on non-output"), |
152 (uprefix + r'.*\|\s*sed[^|>\n]*\n', | 152 (uprefix + r'.*\|\s*sed[^|>\n]*\n', |
153 "use regex test output patterns instead of sed"), | 153 "use regex test output patterns instead of sed"), |
154 (uprefix + r'(true|exit 0)', "explicit zero exit unnecessary"), | 154 (uprefix + r'(true|exit 0)', "explicit zero exit unnecessary"), |
155 (uprefix + r'.*(?<!\[)\$\?', "explicit exit code checks unnecessary"), | 155 (uprefix + r'.*(?<!\[)\$\?', "explicit exit code checks unnecessary"), |
156 (uprefix + r'.*\|\| echo.*(fail|error)', | 156 (uprefix + r'.*\|\| echo.*(fail|error)', |