Bug 1429457 - [mozlint] Create formal 'setup' mechanism for bootstrapping lint dependencies, r=gbrown

This allows linters to define a 'setup' method which will automatically be
called by |mach lint| before running the linter. Users can also explicitly run
these methods (without doing any actual linting) by running |mach lint --setup|.

MozReview-Commit-ID: 74aY1pfsaX1
This commit is contained in:
Andrew Halberstadt
2018-01-25 13:40:02 -05:00
parent cc82d47e35
commit 2359a4b0a5
15 changed files with 199 additions and 37 deletions

View File

@@ -136,14 +136,14 @@ def run_process(config, cmd):
proc.kill()
def lint(paths, config, **lintargs):
def setup(root):
if not reinstall_flake8():
print(FLAKE8_INSTALL_ERROR)
return 1
binary = get_flake8_binary()
def lint(paths, config, **lintargs):
binary = get_flake8_binary()
cmdargs = [
binary,
'--format', '{"path":"%(path)s","lineno":%(row)s,'