Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

TM_PYCHECKER_OPTIONS for checker customizations

This allows you do pass options to your preferred checker - for example, passing
--max-line-length to newer pep8/flake8:

    TM_PYCHECKER = "flake8"
    TM_PYCHECKER_OPTIONS = "--max-line-length=110"
  • Loading branch information...
commit 8492913c06d7735033acca223b5ea5ec74014cc9 1 parent 908f6d8
Chris Adams authored

Showing 1 changed file with 7 additions and 5 deletions. Show diff stats Hide diff stats

  1. +7 5 Support/bin/pycheckmate.py
12 Support/bin/pycheckmate.py
@@ -247,6 +247,8 @@ def find_checker_program():
247 247 checkers = ["pychecker", "pyflakes", "pylint", "pep8", "flake8"]
248 248 tm_pychecker = os.getenv("TM_PYCHECKER")
249 249
  250 + opts = filter(None, os.getenv('TM_PYCHECKER_OPTIONS', '').split())
  251 +
250 252 if tm_pychecker == "builtin":
251 253 return ('', None, "Syntax check only")
252 254
@@ -278,7 +280,7 @@ def find_checker_program():
278 280 status = p.close()
279 281 if status is None and version:
280 282 version = "PyChecker %s" % version
281   - return (checker, None, version)
  283 + return (checker, opts, version)
282 284
283 285 elif basename == "pylint":
284 286 p = os.popen('"%s" --version 2>/dev/null' % (checker))
@@ -288,7 +290,7 @@ def find_checker_program():
288 290 version = re.sub('^pylint\s*', '', version)
289 291 version = re.sub(',$', '', version)
290 292 version = "Pylint %s" % version
291   - opts = ('--output-format=parseable',)
  293 + opts += ('--output-format=parseable',)
292 294 return (checker, opts, version)
293 295
294 296 elif basename == "pyflakes":
@@ -298,7 +300,7 @@ def find_checker_program():
298 300 output = p.readlines()
299 301 status = p.close()
300 302 if status is None and not output:
301   - return (checker, None, "PyFlakes")
  303 + return (checker, opts, "PyFlakes")
302 304
303 305 elif basename == "pep8":
304 306 p = os.popen('"%s" --version 2>/dev/null' % (checker))
@@ -308,7 +310,7 @@ def find_checker_program():
308 310 version = "PEP 8 %s" % version
309 311 global PYCHECKER_RE
310 312 PYCHECKER_RE = re.compile(r"^(.*?\.pyc?):(\d+):(?:\d+:)?\s+(.*)$")
311   - return (checker, None, version)
  313 + return (checker, opts, version)
312 314
313 315 elif basename == "flake8":
314 316 p = os.popen('"%s" --version 2>/dev/null' % (checker))
@@ -317,7 +319,7 @@ def find_checker_program():
317 319 if status is None and version:
318 320 version = "flake8 %s" % version
319 321 PYCHECKER_RE = re.compile(r"^(.*?\.pyc?):(\d+):(?:\d+:)?\s+(.*)$")
320   - return (checker, None, version)
  322 + return (checker, opts, version)
321 323
322 324 return ('', None, "Syntax check only")
323 325

0 comments on commit 8492913

Please sign in to comment.
Something went wrong with that request. Please try again.