Merge lp:~dholbach/click-reviewers-tools/1364449 into lp:click-reviewers-tools

Proposed by Daniel Holbach
Status: Merged
Approved by: Jamie Strandboge
Approved revision: 236
Merged at revision: 236
Proposed branch: lp:~dholbach/click-reviewers-tools/1364449
Merge into: lp:click-reviewers-tools
Diff against target: 80 lines (+19/-9)
4 files modified
bin/click-review (+6/-4)
clickreviews/modules.py (+7/-3)
clickreviews/tests/test_modules.py (+3/-1)
debian/changelog (+3/-1)
To merge this branch: bzr merge lp:~dholbach/click-reviewers-tools/1364449
Reviewer Review Type Date Requested Status
Jamie Strandboge (community) Approve
Review via email: mp+233088@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Looks good, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/click-review'
--- bin/click-review 2014-09-01 14:52:33 +0000
+++ bin/click-review 2014-09-02 16:33:39 +0000
@@ -88,15 +88,17 @@
88 #88 #
89 section = module.replace('cr_', '')89 section = module.replace('cr_', '')
90 review = modules.init_main_class(module, self.click_fn)90 review = modules.init_main_class(module, self.click_fn)
91 review.do_checks()91 if review:
92 self.results[section] = review.click_report92 review.do_checks()
93 return section93 self.results[section] = review.click_report
94 return None
9495
95 def run_all_checks(self):96 def run_all_checks(self):
96 if self.args.sdk:97 if self.args.sdk:
97 for module in self.cr_modules:98 for module in self.cr_modules:
98 section = self._run_module_checks(module)99 section = self._run_module_checks(module)
99 self._report_module(section)100 if section:
101 self._report_module(section)
100 else:102 else:
101 for module in self.cr_modules:103 for module in self.cr_modules:
102 self._run_module_checks(module)104 self._run_module_checks(module)
103105
=== modified file 'clickreviews/modules.py'
--- clickreviews/modules.py 2014-08-27 17:16:31 +0000
+++ clickreviews/modules.py 2014-09-02 16:33:39 +0000
@@ -48,11 +48,13 @@
48 module_name))48 module_name))
4949
50 classes = inspect.getmembers(module, inspect.isclass)50 classes = inspect.getmembers(module, inspect.isclass)
51 find_main_class = lambda a: a[0].startswith('Click') and \51 find_cr_class = lambda a: a[0].startswith('Click') and \
52 not a[0].endswith('Exception') and \52 not a[0].endswith('Exception') and \
53 a[1].__module__ == module_name53 a[1].__module__ == module_name
54 main_class = list(filter(find_main_class, classes))54 cr_class = list(filter(find_cr_class, classes))
55 init_object = getattr(module, main_class[0][0])55 if not cr_class:
56 return None
57 init_object = getattr(module, cr_class[0][0])
56 return init_object58 return init_object
5759
5860
@@ -64,4 +66,6 @@
64 '''66 '''
6567
66 init_object = find_main_class(module_name)68 init_object = find_main_class(module_name)
69 if not init_object:
70 return None
67 return init_object(click_file)71 return init_object(click_file)
6872
=== modified file 'clickreviews/tests/test_modules.py'
--- clickreviews/tests/test_modules.py 2014-08-27 17:18:45 +0000
+++ clickreviews/tests/test_modules.py 2014-09-02 16:33:39 +0000
@@ -26,4 +26,6 @@
26 review = modules.find_main_class(module_name)26 review = modules.find_main_class(module_name)
27 if review:27 if review:
28 count += 128 count += 1
29 self.assertEqual(count, len(self.cr_modules))29 self.assertEqual(count, len(self.cr_modules),
30 'Not all files in clickreviews/cr_*.py contain '
31 'classes named Click*Review.')
3032
=== modified file 'debian/changelog'
--- debian/changelog 2014-09-01 14:37:20 +0000
+++ debian/changelog 2014-09-02 16:33:39 +0000
@@ -4,8 +4,10 @@
4 into its own module, add tests for it.4 into its own module, add tests for it.
5 * Refactor bin/click-review to make it easier to extend.5 * Refactor bin/click-review to make it easier to extend.
6 * Add --sdk option, so the SDK can start using it. (LP: #1363857)6 * Add --sdk option, so the SDK can start using it. (LP: #1363857)
7 * Safeguard against broken clickreviews check modules, or modules that are
8 still in development. (LP: #1364449)
79
8 -- Daniel Holbach <daniel.holbach@ubuntu.com> Wed, 27 Aug 2014 16:22:03 +020010 -- Daniel Holbach <daniel.holbach@ubuntu.com> Tue, 02 Sep 2014 18:31:50 +0200
911
10click-reviewers-tools (0.9) utopic; urgency=medium12click-reviewers-tools (0.9) utopic; urgency=medium
1113

Subscribers

People subscribed via source and target branches