Patchwork [7,of,7] check-code: reject import cStringIO

login
register
mail settings
Submitter timeless@mozdev.org
Date April 6, 2016, 9:57 p.m.
Message ID <670b4e0794aebc10df22.1459979864@waste.org>
Download mbox | patch
Permalink /patch/14407/
State Accepted
Headers show

Comments

timeless@mozdev.org - April 6, 2016, 9:57 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1459974914 0
#      Wed Apr 06 20:35:14 2016 +0000
# Node ID 670b4e0794aebc10df2298a7bea28a9135589beb
# Parent  5d3336fefe3a4df0f907980361be7c5b3947eab3
check-code: reject import cStringIO

please use the util.stringio alias instead
Augie Fackler - April 7, 2016, 1:20 a.m.
On Wed, Apr 06, 2016 at 04:57:44PM -0500, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1459974914 0
> #      Wed Apr 06 20:35:14 2016 +0000
> # Node ID 670b4e0794aebc10df2298a7bea28a9135589beb
> # Parent  5d3336fefe3a4df0f907980361be7c5b3947eab3
> check-code: reject import cStringIO

these are queued, thanks

>
> please use the util.stringio alias instead
>
> diff --git a/contrib/check-code.py b/contrib/check-code.py
> --- a/contrib/check-code.py
> +++ b/contrib/check-code.py
> @@ -316,6 +316,7 @@
>      (r'def.*[( ]\w+=\{\}', "don't use mutable default arguments"),
>      (r'\butil\.Abort\b', "directly use error.Abort"),
>      (r'^import Queue', "don't use Queue, use util.queue + util.empty"),
> +    (r'^import cStringIO', "don't use cStringIO.StringIO, use util.stringio"),
>    ],
>    # warnings
>    [
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -316,6 +316,7 @@ 
     (r'def.*[( ]\w+=\{\}', "don't use mutable default arguments"),
     (r'\butil\.Abort\b', "directly use error.Abort"),
     (r'^import Queue', "don't use Queue, use util.queue + util.empty"),
+    (r'^import cStringIO', "don't use cStringIO.StringIO, use util.stringio"),
   ],
   # warnings
   [