[PATCH 2 of 2] check-code: add a rule banning `env -u`

timeless timeless at gmail.com
Fri May 6 11:37:12 EDT 2016


Err, rather, not this. +1 to the idea of banning env -u via checkcode,
but the message should suggest env -i ...

On Fri, May 6, 2016 at 11:36 AM, timeless <timeless at gmail.com> wrote:
> fwiw, I'm +1 on this
>
> On Fri, May 6, 2016 at 9:47 AM, Kevin Bullock
> <kbullock+mercurial at ringworld.org> wrote:
>> # HG changeset patch
>> # User Kevin Bullock <kbullock+mercurial at ringworld.org>
>> # Date 1462542356 18000
>> #      Fri May 06 08:45:56 2016 -0500
>> # Node ID 6bd8b35cb95440690ab8dbd6cbb7a2d57ba3faee
>> # Parent  eb319adf9c828aedab8cc23aba33b4c06e9356c4
>> check-code: add a rule banning `env -u`
>>
>> diff --git a/contrib/check-code.py b/contrib/check-code.py
>> --- a/contrib/check-code.py
>> +++ b/contrib/check-code.py
>> @@ -133,6 +133,7 @@ testpats = [
>>      (r'\|&', "don't use |&, use 2>&1"),
>>      (r'\w =  +\w', "only one space after = allowed"),
>>      (r'\bsed\b.*[^\\]\\n', "don't use 'sed ... \\n', use a \\ and a newline"),
>> +    (r'env.*-u', "don't use 'env -u VAR', use 'unset VAR'")
>>    ],
>>    # warnings
>>    [
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel at mercurial-scm.org
>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list