From 43dbc42d87fefb2bc66c4a67cfbac00cd9e94772 Mon Sep 17 00:00:00 2001
From: Campbell Barton <ideasman42@gmail.com>
Date: Tue, 12 Sep 2017 13:46:22 +1000
Subject: [PATCH] Fix skipping hidden files
---
check_source/check_header_duplicate.py | 6 ++----
check_source/check_spelling.py | 4 +---
check_source/check_style_c.py | 6 ++----
3 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/check_source/check_header_duplicate.py b/check_source/check_header_duplicate.py
index 02217d5..1394f69 100755
--- a/check_source/check_header_duplicate.py
+++ b/check_source/check_header_duplicate.py
@@ -73,10 +73,8 @@ def scan_source_recursive(dirpath, is_restore):
def source_list(path, filename_check=None):
for dirpath, dirnames, filenames in os.walk(path):
-
- # skip '.svn'
- if dirpath.startswith("."):
- continue
+ # skip '.git'
+ dirnames[:] = [d for d in dirnames if not d.startswith(".")]
for filename in filenames:
filepath = join(dirpath, filename)
diff --git a/check_source/check_spelling.py b/check_source/check_spelling.py
index 20700a2..4057741 100755
--- a/check_source/check_spelling.py
+++ b/check_source/check_spelling.py
@@ -331,10 +331,8 @@ def spell_check_comments_recursive(dirpath):
def source_list(path, filename_check=None):
for dirpath, dirnames, filenames in os.walk(path):
-
# skip '.git'
- if dirpath.startswith("."):
- continue
+ dirnames[:] = [d for d in dirnames if not d.startswith(".")]
for filename in filenames:
filepath = join(dirpath, filename)
diff --git a/check_source/check_style_c.py b/check_source/check_style_c.py
index 0c48f92..286cba1 100755
--- a/check_source/check_style_c.py
+++ b/check_source/check_style_c.py
@@ -1300,10 +1300,8 @@ def scan_source_recursive(dirpath, args):
def source_list(path, filename_check=None):
for dirpath, dirnames, filenames in os.walk(path):
-
- # skip '.svn'
- if dirpath.startswith("."):
- continue
+ # skip '.git'
+ dirnames[:] = [d for d in dirnames if not d.startswith(".")]
for filename in filenames:
filepath = join(dirpath, filename)
--
GitLab