Submitter | Augie Fackler |
---|---|
Date | Sept. 20, 2013, 5:19 p.m. |
Message ID | <08a37126954a5b653c1d.1379697579@arthedain.pit.corp.google.com> |
Download | mbox | patch |
Permalink | /patch/2573/ |
State | Accepted |
Commit | 6fb1b7728719716753cedbd9ff431a75875b25c8 |
Headers | show |
Comments
On Fri, 2013-09-20 at 13:19 -0400, Augie Fackler wrote: > # HG changeset patch > # User Augie Fackler <raf@durin42.com> > # Date 1379686689 14400 > # Fri Sep 20 10:18:09 2013 -0400 > # Node ID 08a37126954a5b653c1dee4820f9065d3723179b > # Parent 291285a2fa6a9a65b912687e3d05fddaf4d5912e > check-code: new rule to forbid imports of a.b on the same line as other imports These are queued for default, thanks.
On Mon, 2013-09-23 at 13:43 -0700, Matt Mackall wrote: > On Fri, 2013-09-20 at 13:19 -0400, Augie Fackler wrote: > > # HG changeset patch > > # User Augie Fackler <raf@durin42.com> > > # Date 1379686689 14400 > > # Fri Sep 20 10:18:09 2013 -0400 > > # Node ID 08a37126954a5b653c1dee4820f9065d3723179b > > # Parent 291285a2fa6a9a65b912687e3d05fddaf4d5912e > > check-code: new rule to forbid imports of a.b on the same line as other imports > > These are queued for default, thanks. And by 'these', I mean the first 8. Still thinking about the last two.
On Sep 23, 2013, at 4:56 PM, Matt Mackall <mpm@selenic.com> wrote: > On Mon, 2013-09-23 at 13:43 -0700, Matt Mackall wrote: >> On Fri, 2013-09-20 at 13:19 -0400, Augie Fackler wrote: >>> # HG changeset patch >>> # User Augie Fackler <raf@durin42.com> >>> # Date 1379686689 14400 >>> # Fri Sep 20 10:18:09 2013 -0400 >>> # Node ID 08a37126954a5b653c1dee4820f9065d3723179b >>> # Parent 291285a2fa6a9a65b912687e3d05fddaf4d5912e >>> check-code: new rule to forbid imports of a.b on the same line as other imports >> >> These are queued for default, thanks. > > And by 'these', I mean the first 8. Still thinking about the last two. Thanks. Do you want to talk about them on IRC sometime?
Patch
diff --git a/contrib/check-code.py b/contrib/check-code.py --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -162,6 +162,9 @@ "tuple parameter unpacking not available in Python 3+"), (r'lambda\s*\(.*,.*\)', "tuple parameter unpacking not available in Python 3+"), + (r'import (.+,[^.]+\.[^.]+|[^.]+\.[^.]+,)', + '2to3 can\'t always rewrite "import qux, foo.bar", ' + 'use "import foo.bar" on its own line instead.'), (r'(?<!def)\s+(cmp)\(', "cmp is not available in Python 3+"), (r'\breduce\s*\(.*', "reduce is not available in Python 3+"), (r'\.has_key\b', "dict.has_key is not available in Python 3+"),