Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(714)

Side by Side Diff: common/eslint/bin/run_eslint

Issue 2361623007: Add a run_eslint wrapper script (Closed)
Patch Set: Checkpoint. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2
3 # Copyright 2016 The Chromium Authors. All rights reserved. 2 # Copyright 2016 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 4 # found in the LICENSE file.
6 5
7 import os 6 import os
8 import sys 7 import sys
9 8
10 _SYSTRACE_DIR = os.path.abspath( 9
10 _ESLINT_PATH = os.path.abspath(
11 os.path.join(os.path.dirname(__file__), os.path.pardir)) 11 os.path.join(os.path.dirname(__file__), os.path.pardir))
12 sys.path.insert(0, _SYSTRACE_DIR) 12
13 from systrace import run_systrace 13
14 def _AddToPathIfNeeded(path):
15 if path not in sys.path:
16 sys.path.insert(0, path)
17
14 18
15 if __name__ == '__main__': 19 if __name__ == '__main__':
16 sys.exit(run_systrace.main()) 20 _AddToPathIfNeeded(_ESLINT_PATH)
21 from eslint import eslint
22
23 if len(sys.argv) == 1:
24 print eslint.RunEslintGlobal()
25 else:
26 print eslint.RunEslint(sys.argv[1:])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698