Skip to content

Commit

Permalink
Fixed lint checking directories it shouldn't be
Browse files Browse the repository at this point in the history
Lint earlier checked _venv/ and .git/ which it shouldn't be checking.
Also closes #8445
which arose due to the lint logger passing error messages to the root logger.
  • Loading branch information
Cactusmachete committed Mar 22, 2018
1 parent fc04bb5 commit 7578a13
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tools/gitignore/gitignore.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def parse_line(line):
if dir_only:
line = line[:-1]

return invert, dir_only, fnmatch_translate(line, "/" in line)
return invert, dir_only, fnmatch_translate(line, dir_only)


class PathFilter(object):
Expand Down
7 changes: 3 additions & 4 deletions tools/lint/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def setup_logging(prefix=False):
for handler in logger.handlers:
handler.setFormatter(formatter)
logger.setLevel(logging.DEBUG)

logger.propagate = False

setup_logging()

Expand All @@ -60,7 +60,7 @@ def setup_logging(prefix=False):
%s: %s"""

def all_filesystem_paths(repo_root, subdir=None):
path_filter = PathFilter(repo_root, extras=[".git/*"])
path_filter = PathFilter(repo_root, extras=[".git/"])
if subdir:
expanded_path = subdir
else:
Expand All @@ -72,8 +72,7 @@ def all_filesystem_paths(repo_root, subdir=None):
yield path
dirnames[:] = [item for item in dirnames if
path_filter(os.path.relpath(os.path.join(dirpath, item) + "/",
repo_root))]

repo_root)+"/")]

def _all_files_equal(paths):
"""
Expand Down

0 comments on commit 7578a13

Please sign in to comment.