19 Commits

Author SHA1 Message Date
Monty Taylor
c1c068bb6b Make missing imports flag in hacking settable.
Change-Id: Ib1ada320588eb42370c9fa2c0eff4eb888258ea5
2012-08-17 13:38:29 -04:00
Joe Gordon
47a1bbe311 Add a 50 char git title limit test to hacking.
* add N802 to hacking.py

Change-Id: I8262531b4b3f8f3a1a2a37679904cf4864cae7b6
2012-08-08 14:53:38 -07:00
Monty Taylor
b71e86d4d7 Fix broken pep8 exclude processing.
First of all, our pep8 exclude was excluding openstack, to trap
for not doing pep8 checks on openstack/common, which comes from elsewhere.
But, pep8 strips filenames down to basename when doing exclude checks on
them, which makes no sense. To fix this, grab the two functions from pep8,
fix them, and monkeypatch them from within hacking.py.

Patch has been submitted upstream as:

  https://github.com/jcrocholl/pep8/pull/111

Also, changed the exclude to catch just openstack/common.

Change-Id: If0b18ae828e74203f84a8b6f8b4ba0100b3bbc59
2012-08-03 12:15:44 -05:00
Chris Behrens
e6f2e886a4 Replace subprocess.check_output with Popen
The check_output method does not exist in python 2.6

Fixes bug 1029014

Change-Id: I1ee24fa2029f21706924cc19dfcbc41655b022e6
2012-07-26 09:15:09 +00:00
Joe Gordon
7a376fa48b Add git commit message validation to hacking.py
Adds N801: git commit title should provide a description

Change-Id: Ic6334b20f5f06631b7a5579a4d1b2303685463eb
2012-07-20 15:19:15 -07:00
Sean Dague
7b43eaa9d8 modify hacking.py to not choke on the def of _()
recent openstack-common brought in it's own def of _() which trips
up our checking that all _ calls contain a message string.

This explicitly excludes the definition of this in function from
that check.

Fixes LP Bug #1020792.

Change-Id: If647d77a5ae5560935bb2e032331c34b896b8614
2012-07-05 16:59:48 -04:00
Brian Waldon
90a93098a6 Correct typo in tools/hacking.py l18n -> i18n
i18n stands for internationalization, while l10n stands for
localization. l18n stands for nothing.

Change-Id: Iebfe2dcbc12919875c0ecee8aa9223dc107239d7
2012-07-05 09:50:55 -07:00
Zhongyue Luo
61c5597a09 Backslash continuation removal (Nova folsom-2)
Fixes bug #938588

Backslash continuations removal for scripts in bin/, plugin/, and etc.

Change-Id: Idd17048b6e8db6e939946968e011e68da8585b8d
2012-05-31 11:26:37 +08:00
Jenkins
7f910cddc3 Merge "Cleanup tools/hacking using flake8" 2012-05-31 01:50:46 +00:00
Matt Joyce
d5cc5fd2f0 Grammar fixes.
Change-Id: Iff3f5765193e0bc98dfc377ee5a9b6f47ae11859
2012-05-29 13:01:57 -07:00
Joe Gordon
6e480708ee Cleanup tools/hacking using flake8
Change-Id: Ia151f265bf62e6704de6cc2f2c01963be9e2dd69
2012-05-24 12:03:37 -07:00
Brian Waldon
317378f742 Update pep8 dependency to v1.1
The latest release of pep8 adds stricter rules for extraneous
whitespace within lines. This patch also addresses these new
violations acoss the codebase.

Change-Id: Ib7e50281870473df1704ed50868c5c2e26bdb02e
2012-05-24 06:59:05 -07:00
Joe Gordon
82e1019edb Number of missing imports should always be shown
In tools/hacking.py

Change-Id: I1219dcc140594be97fc680981a122157fed2e279
2012-04-24 13:00:13 -07:00
Joe Gordon
7ee0d7848d Improved tools/hacking.py
* cleaner output
* fix bug 980009
* Fix N201
* N306: alphabetical order imports
* N401: docstring start
* N402: one line docstring start
* N403: multi line docstring end
* Until fixed, N40* will be disabled by default

Change-Id: I9addafdaa7a1f8fb950e14a5409f661dec6c7b87
2012-04-24 09:29:43 -07:00
Yuriy Taraday
4fe6f839bd Improved localization testing.
Moved localization tests to tools/hacking.py.

Change-Id: I903b90dfb09a46a72b1c64c30301f90661999f5b
2012-04-10 22:01:55 +04:00
Yuriy Taraday
f7a6c58d92 HACKING fixes, sqlalchemy fix.
Add exceptions to hacking.py make sqlalchemy stuff legal and prevent
clutter.

Change-Id: I44b100b4c0c4dfcec81beea7aba2d8598d5a08d0
2012-04-09 18:00:40 +04:00
Yuriy Taraday
01a938f7fe HACKING fixes, all but sqlalchemy.
Looks like this fixes all HACKING problems that were around.
Thanks to Dina Belova and Alexander Kovalev for this work.

Change-Id: I8157f0d4890184c1216aab63ef7180ee8b7a184d
2012-03-07 12:51:39 +04:00
Joe Gordon
e8bc00eff2 Add assertRaises check to tools/hacking.py as N202
Change-Id: I25113bcc73ff642cae146f0558f319684b4568d0
2012-03-05 14:09:57 -08:00
Joe Gordon
9a08e00548 Add HACKING compliance testing to run_test.sh
Tests so far:
N101 TODO format
N201 Except format
N301 One import per line
N302 import only modules
N303 Invalid Import
N304 Relative Import

Change-Id: I33c021b842e7199b1f5f1f699ea17f7fa5f8ca49
2012-01-24 10:54:17 -08:00