From patchwork Sat Sep 7 06:32:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D6789: check-code: allow command substitution with $(command) From: phabricator X-Patchwork-Id: 41494 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Sat, 7 Sep 2019 06:32:25 +0000 martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Both `command` and $(command) are specified by POSIX. The latter nests better. I don't see why we shouldn't allow both (or only the latter). REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6789 AFFECTED FILES contrib/check-code.py CHANGE DETAILS To: martinvonz, #hg-reviewers Cc: mercurial-devel diff --git a/contrib/check-code.py b/contrib/check-code.py --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -116,7 +116,6 @@ (r'\bls\b.*-\w*R', "don't use 'ls -R', use 'find'"), (r'printf.*[^\\]\\([1-9]|0\d)', r"don't use 'printf \NNN', use Python"), (r'printf.*[^\\]\\x', "don't use printf \\x, use Python"), - (r'\$\(.*\)', "don't use $(expr), use `expr`"), (r'rm -rf \*', "don't use naked rm -rf, target a directory"), (r'\[[^\]]+==', '[ foo == bar ] is a bashism, use [ foo = bar ] instead'), (r'(^|\|\s*)grep (-\w\s+)*[^|]*[(|]\w',