aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Wendling <morbo@google.com>2018-05-21 14:56:15 -0700
committerBill Wendling <morbo@google.com>2018-05-21 14:56:15 -0700
commit6cc0be864377bd882f54831af537ea34363ecbe8 (patch)
treee0000b8f3b5b411cf26361a438b62f2eb4d5666b
parent19dbc7ad88115d3acb08b1b68fce1971df32e741 (diff)
downloadyapf-6cc0be864377bd882f54831af537ea34363ecbe8.tar.gz
Fix lint warnings.
-rw-r--r--yapf/yapflib/file_resources.py4
-rw-r--r--yapftests/file_resources_test.py3
2 files changed, 4 insertions, 3 deletions
diff --git a/yapf/yapflib/file_resources.py b/yapf/yapflib/file_resources.py
index 67eea61..764e2d6 100644
--- a/yapf/yapflib/file_resources.py
+++ b/yapf/yapflib/file_resources.py
@@ -148,8 +148,8 @@ def _FindPythonFiles(filenames, recursive, exclude):
def IsIgnored(path, exclude):
"""Return True if filename matches any patterns in exclude."""
- path = path.lstrip("/")
- while path.startswith("./"):
+ path = path.lstrip('/')
+ while path.startswith('./'):
path = path[2:]
return any(fnmatch.fnmatch(path, e.rstrip('/')) for e in exclude)
diff --git a/yapftests/file_resources_test.py b/yapftests/file_resources_test.py
index 5f06e3e..70cea46 100644
--- a/yapftests/file_resources_test.py
+++ b/yapftests/file_resources_test.py
@@ -170,7 +170,8 @@ class GetCommandLineFilesTest(unittest.TestCase):
]))
def test_find_with_excluded_hidden_dirs_relative(self):
- """
+ """Test find with excluded hidden dirs.
+
A regression test against a specific case where a hidden directory (one
beginning with a period) is being excluded, but it is also an immediate
child of the current directory which has been specified in a relative