summaryrefslogtreecommitdiff
path: root/flake8/run.py
diff options
context:
space:
mode:
authorIan Cordasco <graffatcolmingov@gmail.com>2012-11-28 09:51:36 -0500
committerIan Cordasco <graffatcolmingov@gmail.com>2012-11-28 09:51:36 -0500
commit351e9ff7b204e0a4999faac3ec2f1235bfaf47fe (patch)
tree2e91b1fd3e48e74390eeb3a7d0afdd41ac2a8d50 /flake8/run.py
parent8e4e02861f67ca54db8988ffc9b322d4dfb9f524 (diff)
downloadflake8-351e9ff7b204e0a4999faac3ec2f1235bfaf47fe.tar.gz
Seems the git hook now allows items to be ignored.
I am unable to test the mercurial hook however since I seem to have an older version of mercurial. I'd appreciate feedback.
Diffstat (limited to 'flake8/run.py')
-rw-r--r--flake8/run.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/flake8/run.py b/flake8/run.py
index cbb456d..b53ee28 100644
--- a/flake8/run.py
+++ b/flake8/run.py
@@ -126,13 +126,12 @@ def _initpep8():
global pep8style
if pep8style is None:
pep8style = pep8.StyleGuide(config_file=True)
- pep8.options = _PEP8Options()
- pep8.options.physical_checks = pep8.find_checks('physical_line')
- pep8.options.logical_checks = pep8.find_checks('logical_line')
- pep8.options.counters = dict.fromkeys(pep8.BENCHMARK_KEYS, 0)
- pep8.options.messages = {}
- pep8.options.max_line_length = 79
- pep8.args = []
+ #pep8style.options.physical_checks = pep8.find_checks('physical_line')
+ #pep8style.options.logical_checks = pep8.find_checks('logical_line')
+ pep8style.options.counters = dict.fromkeys(pep8.BENCHMARK_KEYS, 0)
+ pep8style.options.messages = {}
+ pep8style.options.max_line_length = 79
+ pep8style.args = []
def run(command):
@@ -145,7 +144,7 @@ def run(command):
def git_hook(complexity=-1, strict=False, ignore=None, lazy=False):
_initpep8()
if ignore:
- pep8.options.ignore = ignore
+ pep8style.options.ignore = ignore
warnings = 0
@@ -160,7 +159,8 @@ def git_hook(complexity=-1, strict=False, ignore=None, lazy=False):
continue
if not os.path.exists(filename):
continue
- warnings += check_file(path=filename, ignore=ignore, complexity=complexity)
+ warnings += check_file(path=filename, ignore=ignore,
+ complexity=complexity)
if strict:
return warnings
@@ -170,7 +170,7 @@ def git_hook(complexity=-1, strict=False, ignore=None, lazy=False):
def hg_hook(ui, repo, **kwargs):
_initpep8()
- complexity = ui.configint('flake8', 'complexity', default=-1)
+ complexity = ui.config('flake8', 'complexity', default=-1)
warnings = 0
for file_ in _get_files(repo, **kwargs):