123456789101112131415161718192021222324252627282930313233343536 |
- #!/usr/bin/env python
- 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())))
|