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

Unified Diff: owners.py

Issue 11434048: allow spaces on the per-file directives in OWNERS files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 8 years, 1 month 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 | tests/owners_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: owners.py
diff --git a/owners.py b/owners.py
index 1dd467f6ff7d7cf30a880a45fc9a661f43ec435c..109273e5c8ac355b03833af61e3a1cfbaa16ad79 100644
--- a/owners.py
+++ b/owners.py
@@ -14,7 +14,7 @@ The syntax of the OWNERS file is, roughly:
lines := (\s* line? \s* "\n")*
line := directive
- | "per-file" \s+ glob "=" directive
+ | "per-file" \s+ glob \s* "=" \s* directive
| comment
directive := "set noparent"
@@ -221,8 +221,8 @@ class Database(object):
m = re.match("per-file (.+)=(.+)", line)
M-A Ruel 2012/11/30 18:37:31 why not re.match(r"per-file\s+(.+)\s*=\s*(.+)\s*",
if m:
- glob_string = m.group(1)
- directive = m.group(2)
+ glob_string = m.group(1).strip()
+ directive = m.group(2).strip()
full_glob_string = self.os_path.join(self.root, dirpath, glob_string)
if '/' in glob_string or '\\' in glob_string:
raise SyntaxErrorInOwnersFile(owners_path, lineno,
« no previous file with comments | « no previous file | tests/owners_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698