diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-10-27 18:52:34 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-10-27 18:52:34 +0000 |
| commit | b2c2a89596487b3e63d463e40c0637eb32ac0f9f (patch) | |
| tree | 47d5fa149c7ab2a6f8f8966352cfb49630d16c9a | |
| parent | 63b7d3ac735be25edef45dc802652de11ef65779 (diff) | |
| parent | fcefe62547c11bae26f237572dad34546213254e (diff) | |
| download | nova-b2c2a89596487b3e63d463e40c0637eb32ac0f9f.tar.gz nova-b2c2a89596487b3e63d463e40c0637eb32ac0f9f.tar.xz nova-b2c2a89596487b3e63d463e40c0637eb32ac0f9f.zip | |
Merge "Change hacking.py N306 to use logical_lines"
| -rwxr-xr-x | tools/hacking.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/hacking.py b/tools/hacking.py index 4e42d3e89..4e013ae4f 100755 --- a/tools/hacking.py +++ b/tools/hacking.py @@ -250,7 +250,7 @@ def nova_import_module_only(logical_line): #TODO(jogo): import template: N305 -def nova_import_alphabetical(physical_line, line_number, lines): +def nova_import_alphabetical(logical_line, line_number, lines): """Check for imports in alphabetical order. nova HACKING guide recommendation for imports: @@ -259,7 +259,7 @@ def nova_import_alphabetical(physical_line, line_number, lines): """ # handle import x # use .lower since capitalization shouldn't dictate order - split_line = import_normalize(physical_line.strip()).lower().split() + split_line = import_normalize(logical_line.strip()).lower().split() split_previous = import_normalize(lines[line_number - 2] ).strip().lower().split() # with or without "as y" @@ -267,7 +267,7 @@ def nova_import_alphabetical(physical_line, line_number, lines): if (len(split_line) in length and len(split_previous) in length and split_line[0] == "import" and split_previous[0] == "import"): if split_line[1] < split_previous[1]: - return (0, "NOVA N306: imports not in alphabetical order (%s, %s)" + yield (0, "NOVA N306: imports not in alphabetical order (%s, %s)" % (split_previous[1], split_line[1])) |
