From 9b21807493f9dec452a8cc7027c71419e77b6672 Mon Sep 17 00:00:00 2001 From: Will Wang Date: Mon, 1 Oct 2018 14:07:49 -0700 Subject: [PATCH] Check if a file is ignored before checking if it's a python file --- git_pylint_commit_hook/commit_hook.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git_pylint_commit_hook/commit_hook.py b/git_pylint_commit_hook/commit_hook.py index a679495..ea0f7ee 100644 --- a/git_pylint_commit_hook/commit_hook.py +++ b/git_pylint_commit_hook/commit_hook.py @@ -223,8 +223,8 @@ def check_repo( # Find Python files for filename in _get_list_of_committed_files(): try: - if _is_python_file(filename) and \ - not _is_ignored(filename, ignored_files): + if not _is_ignored(filename, ignored_files) and \ + _is_python_file(filename): python_files.append((filename, None)) except IOError: print('File not found (probably deleted): {}\t\tSKIPPED'.format(