Bug 1411004 - ./mach clang-format: Better handling of relative paths r=mystor=mystor

For example, this is addressing the issue:
./mach clang-format -p ./mfbt/

MozReview-Commit-ID: Le8mPTOEfA7
This commit is contained in:
Sylvestre Ledru
2017-10-30 18:36:28 +01:00
parent a939b65745
commit 05a64e1166
2 changed files with 130 additions and 129 deletions

View File

@@ -304,7 +304,8 @@ class FormatProvider(MachCommandBase):
# Remove comments and empty lines
if line.startswith('#') or len(line.strip()) == 0:
continue
ignored_dir.append(line.rstrip())
# The regexp is to make sure we are managing relative paths
ignored_dir.append("^[\./]*" + line.rstrip())
# Generates the list of regexp
ignored_dir_re = '(%s)' % '|'.join(ignored_dir)