diff options
author | Darien Hager <dhager@gmi-mr.com> | 2018-03-30 19:10:55 -0700 |
---|---|---|
committer | Darien Hager <dhager@gmi-mr.com> | 2018-03-30 19:10:55 -0700 |
commit | 94ce23bb62c54f888e09e1796380348204e4a2c2 (patch) | |
tree | c0ccd174a3a3f9f4df2a4242bd6be6c0de92037d | |
parent | bb795494351d1e2c77912ce7fcddc42433b73565 (diff) | |
download | yapf-94ce23bb62c54f888e09e1796380348204e4a2c2.tar.gz |
Fix issue with matching against hidden child folders in relative-directory context.
-rw-r--r-- | yapf/yapflib/file_resources.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/yapf/yapflib/file_resources.py b/yapf/yapflib/file_resources.py index 5468ced..67eea61 100644 --- a/yapf/yapflib/file_resources.py +++ b/yapf/yapflib/file_resources.py @@ -148,7 +148,10 @@ def _FindPythonFiles(filenames, recursive, exclude): def IsIgnored(path, exclude): """Return True if filename matches any patterns in exclude.""" - return any(fnmatch.fnmatch(path.lstrip('./'), e.rstrip('/')) for e in exclude) + path = path.lstrip("/") + while path.startswith("./"): + path = path[2:] + return any(fnmatch.fnmatch(path, e.rstrip('/')) for e in exclude) def IsPythonFile(filename): |