[PATCH] check-code.py: use absolute_import and print_function

Yuya Nishihara yuya at tcha.org
Wed Mar 2 09:07:39 EST 2016


On Wed, 2 Mar 2016 04:07:27 +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pulkit at gmail.com>
> # Date 1456871704 -19800
> #      Wed Mar 02 04:05:04 2016 +0530
> # Node ID 90d2a0ee68b0c280db54ac2af7c0446c336b3021
> # Parent  31cedec0974f06ba10c0e40f8a36710b7d2ff5a3
> check-code.py: Added absolute_import and print_function
            ^^^  ^
"check-code: use absolute_import and print_function"

https://www.mercurial-scm.org/wiki/ContributingChanges#Patch_descriptions

And this patch is white-space damaged. You might want to try the push gate.

https://www.mercurial-scm.org/wiki/ContributingChanges#Emailing_patches

> --- a/contrib/check-code.py    Wed Mar 02 03:36:44 2016 +0530
> +++ b/contrib/check-code.py    Wed Mar 02 04:05:04 2016 +0530
> @@ -18,8 +18,12 @@
>   * change the pattern to a warning and list the exception in
> test-check-code-hg
>   * ONLY use no--check-code for skipping entire files from external sources
>  """
> -
> -import re, glob, os, sys
> +from __future__ import absolute_import
> +from __future__ import print_function

We generally put them in a single line.

> +import re
> +import glob
> +import os
> +import sys
>  import keyword
>  import optparse

Please list modules alphabetically. test-check-module-imports.t would warn you.


More information about the Mercurial-devel mailing list