Re: [RFC] Add basic syntax check on shell scripts
- From
Sebastian Schuberth <sschuberth@gmail.com>
- Date
- Dec 5, 2012, 09:11 UTC
- Message-ID
- <50BF0FCD.6080700@gmail.com>
- In-Reply-To
- <7vobi9mwt4.fsf@alter.siamese.dyndns.org>
On 2012/12/04 20:39 , Junio C Hamano wrote:
> A few more things in addition to what Torsten's script attempts to > catch that we would want to catch are:
[...]
> * Do not write ERE with backslashes and expect "grep" to grok them; > that's GNUism. e.g. > > grep "^\(author\|committer\) " > > is bad. Use egrep (or "grep -E") if you want to use ERE.
Yet more thing that is probably worth catching, although not related to bashism: Avoid the use of "which" in favor of e.g. "type".
In any case, having this check as a local pre-commit hook would be great!
-- Sebastian Schuberth