summaryrefslogtreecommitdiff
path: root/bin/find-german-comments
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2017-01-26 17:47:45 +0000
committerMichael Meeks <michael.meeks@collabora.com>2017-01-26 21:09:51 +0000
commit294c78fd65e62f8061dc2d54a4c8b1baa554e407 (patch)
tree0ae879fbd203e9be4029db2c12b2c0fda8b12749 /bin/find-german-comments
parent38b3df0f74c266bf80b0672a7c7f657ca46ae920 (diff)
German comment finding - simplify top-level detection.
Change-Id: Ic75b4fbb84687a86f7eca52f82dd337244339c42 Reviewed-on: https://gerrit.libreoffice.org/33595 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'bin/find-german-comments')
-rwxr-xr-xbin/find-german-comments12
1 files changed, 5 insertions, 7 deletions
diff --git a/bin/find-german-comments b/bin/find-german-comments
index 40b4c9baca51..13653d9e03de 100755
--- a/bin/find-german-comments
+++ b/bin/find-german-comments
@@ -226,16 +226,14 @@ class Parser:
"""
checks each _tracked_ file in a directory recursively
"""
+
+ # top-level project directory -> use whitelist.
globalscan = False
- if re.match(r'.*/core$', os.getcwd()) and directory == '.':
- globalscan = True
+ if os.path.exists(directory + "/.git/config"):
+ globalscan = True
# Change into the given dir, so "git ls-tree" does work.
- # If we want to scan the current dir, we must not do so as we are already there.
- if not globalscan and directory != '.':
- currentdir = os.getcwd()
- os.chdir(currentdir.split("core", 1)[0] + "core/")
- os.chdir(directory)
+ os.chdir(directory)
sock = os.popen(r"git ls-tree -r HEAD --name-only |egrep '\.(c|cc|cpp|cxx|h|hxx|mm)$'")
lines = sock.readlines()