From 3ce87c8a6b4e385e4e14bbe63aaf7eeceff5130e Mon Sep 17 00:00:00 2001 From: Charles Hendrie Date: Sun, 18 Sep 2016 13:05:29 -0500 Subject: [PATCH] Fix code reference to older version of flake8 (#426) The pre-commit module contained a reference to the variable DEFAULT_CONFIG which does not exist in the version of flake8 packaged with the project. The DEFAULT_CONFIG defines the path to the current user's local flake8 config file. The flake8 2.6.2 version packaged with project has been refactored to set the local flake8 config file in the flake8/main.py module. --- hooks/pre-commit | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hooks/pre-commit b/hooks/pre-commit index 5925a453..55645459 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -17,13 +17,12 @@ if 'VIRTUAL_ENV' in os.environ: def py_lint(files_modified): - from flake8.main import DEFAULT_CONFIG from flake8.engine import get_style_guide # remove non-py files and files which no longer exist files_modified = filter(lambda x: x.endswith('.py'), files_modified) - flake8_style = get_style_guide(parse_argv=True, config_file=DEFAULT_CONFIG) + flake8_style = get_style_guide(parse_argv=True) report = flake8_style.check_files(files_modified) return report.total_errors != 0