From 5dd359fd4ddd83b79172bdf5fc7329b215612ebc Mon Sep 17 00:00:00 2001 From: derAnfaenger Date: Sun, 23 Jul 2017 13:18:53 +0200 Subject: [PATCH] testing: Properly exclude files for linting in Windows. For files to be excluded in Windows, their paths have to be normalized, so that the string matching works. --- tools/custom_check.py | 2 +- tools/server_lib/lister.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/custom_check.py b/tools/custom_check.py index 56ce81c..f5ebf0e 100644 --- a/tools/custom_check.py +++ b/tools/custom_check.py @@ -161,7 +161,7 @@ def build_custom_checkers(by_lang): # This rule might give false positives in virtualenv setup files which should be excluded, # and comments which should be rewritten to avoid use of "python2", "python3", etc. {'pattern': 'python[23]', - 'exclude': set(['tools/provision',]), + 'exclude': set(['tools/provision']), 'description': 'Explicit python invocations should not include a version'}, {'pattern': '(^|\s)open\s*\(', 'description': 'open() should not be used in Zulip\'s bots. Use functions' diff --git a/tools/server_lib/lister.py b/tools/server_lib/lister.py index 3f3b0a6..6e8e547 100755 --- a/tools/server_lib/lister.py +++ b/tools/server_lib/lister.py @@ -66,7 +66,7 @@ def list_files(targets=[], ftypes=[], use_shebang=True, modified_only=False, # sys.argv as str, so that battle is already lost. Settle for hoping # everything is UTF-8. repository_root = subprocess.check_output(['git', 'rev-parse', '--show-toplevel']).strip().decode('utf-8') - exclude_abspaths = [os.path.join(repository_root, fpath).rstrip('/') for fpath in exclude] + exclude_abspaths = [os.path.normpath(os.path.join(repository_root, fpath)) for fpath in exclude] cmdline = ['git', 'ls-files'] + targets if modified_only: