Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(992)

Unified Diff: owners.py

Issue 6667072: Fix lint errors in owners file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: owners.py
===================================================================
--- owners.py (revision 78483)
+++ owners.py (working copy)
@@ -16,6 +16,12 @@
BASIC_EMAIL_REGEXP = r'^[\w\-\+\%\.]+\@[\w\-\+\%\.]+$'
+def _assert_is_collection(obj):
+ assert (isinstance(obj, collections.Iterable) and
+ isinstance(obj, collections.Sized) and
+ not isinstance(obj, basestring))
+
+
class SyntaxErrorInOwnersFile(Exception):
def __init__(self, path, lineno, msg):
super(SyntaxErrorInOwnersFile, self).__init__((path, lineno, msg))
@@ -90,19 +96,14 @@
uncovered_files.extend(files_in_d)
return set(uncovered_files)
- def _check_collection(self, obj):
- assert (isinstance(obj, collections.Iterable) and
- isinstance(obj, collections.Sized) and
- not isinstance(obj, basestring))
-
def _check_paths(self, files):
def _is_under(f, pfx):
return self.os_path.abspath(self.os_path.join(pfx, f)).startswith(pfx)
- self._check_collection(files)
+ _assert_is_collection(files)
assert all(_is_under(f, self.os_path.abspath(self.root)) for f in files)
def _check_reviewers(self, reviewers):
- self._check_collection(reviewers)
+ _assert_is_collection(reviewers)
assert all(self.email_regexp.match(r) for r in reviewers)
def _files_by_dir(self, files):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698