[PATCH 01 of 16] checkcode: only match pushd/popd as word

Augie Fackler raf at durin42.com
Tue Apr 11 11:01:30 EDT 2017


On Mon, Apr 10, 2017 at 05:19:37PM +0200, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
> # Date 1491836754 -7200
> #      Mon Apr 10 17:05:54 2017 +0200
> # Node ID f45dcc85f9947b29109e27a20853a531be86f8dc
> # Parent  e0dc40530c5aa514feb6a09cf79ab6a3aa2ec331
> # EXP-Topic exchange.obsmarkers
> # Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
> #              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r f45dcc85f994
> checkcode: only match pushd/popd as word

I've taken this one, but will have to come back to the others later.

>
> otherwise it partially match common words like "pushdestination".
>
> diff --git a/contrib/check-code.py b/contrib/check-code.py
> --- a/contrib/check-code.py
> +++ b/contrib/check-code.py
> @@ -100,7 +100,7 @@ def rephere(m):
>
>  testpats = [
>    [
> -    (r'pushd|popd', "don't use 'pushd' or 'popd', use 'cd'"),
> +    (r'\b(push|pop)d\b', "don't use 'pushd' or 'popd', use 'cd'"),
>      (r'\W\$?\(\([^\)\n]*\)\)', "don't use (()) or $(()), use 'expr'"),
>      (r'grep.*-q', "don't use 'grep -q', redirect to /dev/null"),
>      (r'(?<!hg )grep.* -a', "don't use 'grep -a', use in-line python"),
> _______________________________________________
> 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