1234567891011121314151617181920212223242526272829303132333435363738 |
- from __future__ import absolute_import
- import click
- import os
- import sys
- sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir, 'src'))
- @click.command()
- @click.argument('files', nargs=-1)
- @click.option('--js', default=None, is_flag=True)
- @click.option('--python', default=None, is_flag=True)
- @click.option('--format', default=False, is_flag=True)
- @click.option('--parseable', default=False, is_flag=True)
- def run(files, js, python, format, parseable):
- from sentry.lint import engine
- if js and not python:
- python = False
- elif python and not js:
- js = False
- else:
- js = True
- python = True
- if not files:
- files = None
- results = engine.run(files, js=js, py=python, format=format, parseable=parseable)
- if results:
- raise click.Abort
- if __name__ == '__main__':
- run()
|