contrib/check-code.py
changeset 18832 a911e5dc2b00
parent 18762 a91387a37f05
child 18833 b1a42a6087ca
equal deleted inserted replaced
18831:17f6644a2fbc 18832:a911e5dc2b00
    87 testfilters = [
    87 testfilters = [
    88     (r"( *)(#([^\n]*\S)?)", repcomment),
    88     (r"( *)(#([^\n]*\S)?)", repcomment),
    89     (r"<<(\S+)((.|\n)*?\n\1)", rephere),
    89     (r"<<(\S+)((.|\n)*?\n\1)", rephere),
    90 ]
    90 ]
    91 
    91 
       
    92 winglobmsg = "use (glob) to match Windows paths too"
    92 uprefix = r"^  \$ "
    93 uprefix = r"^  \$ "
    93 utestpats = [
    94 utestpats = [
    94   [
    95   [
    95     (r'^(\S.*||  [$>] .*)[ \t]\n', "trailing whitespace on non-output"),
    96     (r'^(\S.*||  [$>] .*)[ \t]\n', "trailing whitespace on non-output"),
    96     (uprefix + r'.*\|\s*sed[^|>\n]*\n',
    97     (uprefix + r'.*\|\s*sed[^|>\n]*\n',
    99     (uprefix + r'.*(?<!\[)\$\?', "explicit exit code checks unnecessary"),
   100     (uprefix + r'.*(?<!\[)\$\?', "explicit exit code checks unnecessary"),
   100     (uprefix + r'.*\|\| echo.*(fail|error)',
   101     (uprefix + r'.*\|\| echo.*(fail|error)',
   101      "explicit exit code checks unnecessary"),
   102      "explicit exit code checks unnecessary"),
   102     (uprefix + r'set -e', "don't use set -e"),
   103     (uprefix + r'set -e', "don't use set -e"),
   103     (uprefix + r'\s', "don't indent commands, use > for continued lines"),
   104     (uprefix + r'\s', "don't indent commands, use > for continued lines"),
   104     (r'^  saved backup bundle to \$TESTTMP.*\.hg$',
   105     (r'^  saved backup bundle to \$TESTTMP.*\.hg$', winglobmsg),
   105      "use (glob) to match Windows paths too"),
       
   106   ],
   106   ],
   107   # warnings
   107   # warnings
   108   [
   108   [
   109     (r'^  [^*?/\n]* \(glob\)$',
   109     (r'^  [^*?/\n]* \(glob\)$',
   110      "warning: glob match with no glob character (?*/)"),
   110      "warning: glob match with no glob character (?*/)"),