12345678910111213141516171819202122232425262728293031323334353637 |
- #!/usr/bin/env python
- from __future__ import absolute_import
- import os
- import sys
- # This is to avoid needing to have the `sentry` package explicitly installed.
- sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir, 'src'))
- 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
- return engine.run(files, js=js, py=python, format=format, parseable=parseable)
- if __name__ == '__main__':
- import argparse
- parser = argparse.ArgumentParser()
- parser.add_argument('files', nargs='*')
- parser.add_argument('--js', default=None, action='store_true')
- parser.add_argument('--python', default=None, action='store_true')
- parser.add_argument('--format', action='store_true')
- parser.add_argument('--parseable', action='store_true')
- sys.exit(run(**vars(parser.parse_args())))
|