lint 648 B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/env python
  2. from __future__ import absolute_import
  3. import os
  4. import sys
  5. # This is to avoid needing to have the `sentry` package explicitly installed.
  6. sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir, 'src'))
  7. from sentry.lint.engine import check_files
  8. offset = 1
  9. js = True
  10. py = True
  11. # Allow passing a flag for --js or --python only
  12. if len(sys.argv) > 1:
  13. if sys.argv[1] == '--js':
  14. offset = 2
  15. py = False
  16. elif sys.argv[1] == '--python':
  17. offset = 2
  18. js = False
  19. file_list = sys.argv[offset:]
  20. if not file_list:
  21. file_list = None
  22. sys.exit(check_files(file_list, js=js, py=py))