Browse Source

Document up linter about not depending on non-stdlib resources

Matt Robenolt 9 years ago
parent
commit
daabdd75e6
2 changed files with 13 additions and 0 deletions
  1. 1 0
      bin/lint
  2. 12 0
      src/sentry/lint/engine.py

+ 1 - 0
bin/lint

@@ -4,6 +4,7 @@ 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'))
 
 from sentry.lint.engine import check_files

+ 12 - 0
src/sentry/lint/engine.py

@@ -1,3 +1,15 @@
+"""
+Our linter engine needs to run in 3 different scenarios:
+ * Linting all files (python and js)
+ * Linting only python files (--python)
+ * Linting only js files (--js)
+
+For the js only path, we should not depend on any packages outside the
+python stdlib to prevent the need to install the world just to run eslint.
+
+This also means imports should be done lazily/inside of function calls for
+dependencies such as flake8/pep8.
+"""
 from __future__ import absolute_import
 
 import os