Mercurial > public > mercurial-scm > hg
comparison contrib/check-code.py @ 34061:11499bad0359
check-code: forbid "\S" in egrep regular expression
BSD `egrep` does not like it. So let's forbid it.
Differential Revision: https://phab.mercurial-scm.org/D610
author | Jun Wu <quark@fb.com> |
---|---|
date | Fri, 01 Sep 2017 16:44:30 -0700 |
parents | e267d4ee4f2d |
children | ba6e14f9a2d8 |
comparison
equal
deleted
inserted
replaced
34060:e267d4ee4f2d | 34061:11499bad0359 |
---|---|
117 (r'\$\(.*\)', "don't use $(expr), use `expr`"), | 117 (r'\$\(.*\)', "don't use $(expr), use `expr`"), |
118 (r'rm -rf \*', "don't use naked rm -rf, target a directory"), | 118 (r'rm -rf \*', "don't use naked rm -rf, target a directory"), |
119 (r'\[[^\]]+==', '[ foo == bar ] is a bashism, use [ foo = bar ] instead'), | 119 (r'\[[^\]]+==', '[ foo == bar ] is a bashism, use [ foo = bar ] instead'), |
120 (r'(^|\|\s*)grep (-\w\s+)*[^|]*[(|]\w', | 120 (r'(^|\|\s*)grep (-\w\s+)*[^|]*[(|]\w', |
121 "use egrep for extended grep syntax"), | 121 "use egrep for extended grep syntax"), |
122 (r'(^|\|\s*)e?grep .*\\S', "don't use \\S in regular expression"), | |
122 (r'(?<!!)/bin/', "don't use explicit paths for tools"), | 123 (r'(?<!!)/bin/', "don't use explicit paths for tools"), |
123 (r'#!.*/bash', "don't use bash in shebang, use sh"), | 124 (r'#!.*/bash', "don't use bash in shebang, use sh"), |
124 (r'[^\n]\Z', "no trailing newline"), | 125 (r'[^\n]\Z', "no trailing newline"), |
125 (r'export .*=', "don't export and assign at once"), | 126 (r'export .*=', "don't export and assign at once"), |
126 (r'^source\b', "don't use 'source', use '.'"), | 127 (r'^source\b', "don't use 'source', use '.'"), |