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

login
register
mail settings
Submitter timeless@mozdev.org
Date April 8, 2016, 4:22 p.m.
Message ID <eedcfda1388d40f947f9.1460132571@waste.org>
Download mbox | patch
Permalink /patch/14444/
State Accepted
Headers show

Comments

timeless@mozdev.org - April 8, 2016, 4:22 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1460127658 0
#      Fri Apr 08 15:00:58 2016 +0000
# Node ID eedcfda1388d40f947f9fa616817f8f46b3a4ce6
# Parent  d08199e5ab0891449c03373c1abb5fc491241b20
check-code: reject import cStringIO
Augie Fackler - April 9, 2016, 2:01 a.m.
On Fri, Apr 08, 2016 at 11:22:51AM -0500, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1460127658 0
> #      Fri Apr 08 15:00:58 2016 +0000
> # Node ID eedcfda1388d40f947f9fa616817f8f46b3a4ce6
> # Parent  d08199e5ab0891449c03373c1abb5fc491241b20
> check-code: reject import cStringIO
>

queued thanks

> 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
   [