Commits

Kevin Stanton  committed 00e1199

implements #55

  • Participants
  • Parent commits 61b1bc1
  • Branches hg-hook-config-file-setting

Comments (0)

Files changed (1)

File flake8/run.py

     max_line_length = pep8.MAX_LINE_LENGTH
 
 
-def _initpep8():
+def _initpep8(config_file=True):
     # default pep8 setup
     global pep8style
     if pep8style is None:
-        pep8style = pep8.StyleGuide(config_file=True)
+        pep8style = pep8.StyleGuide(config_file=config_file)
     #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 hg_hook(ui, repo, **kwargs):
-    _initpep8()
+    config_file = ui.config('flake8', 'config', default=True)
+    _initpep8(config_file)
     complexity = ui.config('flake8', 'complexity', default=-1)
     warnings = 0