Commit 923950f7 authored by dpranke@chromium.org's avatar dpranke@chromium.org

Fix lint errors in owners file.

R=maruel@chromium.org,chase@chromium.org
Review URL: http://codereview.chromium.org/6667072

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@78630 0039d316-1c4b-4281-b951-d872f2087c98
parent 73ac0f11
......@@ -16,6 +16,12 @@ EVERYONE = '*'
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 @@ class Database(object):
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):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment