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

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

Issue 2535983002: [eslint] Don't treat eslint warnings as PRESUBMIT errors (Closed)
Patch Set: fix smoke test Created 4 years 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
« no previous file with comments | « catapult_build/js_checks.py ('k') | common/eslint/eslint/__init__.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2016 The Chromium Authors. All rights reserved. 2 # Copyright 2016 The Chromium Authors. All rights reserved.
3 # 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
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import argparse 6 import argparse
7 import os 7 import os
8 import sys 8 import sys
9 9
10 10
(...skipping 16 matching lines...) Expand all
27 if path not in sys.path: 27 if path not in sys.path:
28 sys.path.insert(0, path) 28 sys.path.insert(0, path)
29 29
30 30
31 if __name__ == '__main__': 31 if __name__ == '__main__':
32 _AddToPathIfNeeded(_ESLINT_PATH) 32 _AddToPathIfNeeded(_ESLINT_PATH)
33 import eslint 33 import eslint
34 34
35 parser = argparse.ArgumentParser( 35 parser = argparse.ArgumentParser(
36 description='Wrapper script to run eslint on Catapult code') 36 description='Wrapper script to run eslint on Catapult code')
37 parser.add_argument('--files', '-f', default=None, nargs='+', metavar='FILE', 37 parser.add_argument('--paths', '-p', default=None, nargs='+', metavar='PATH',
38 help='List of files to lint') 38 help='List of paths to lint')
39 parser.add_argument('--all', default=None, action='store_true', 39 parser.add_argument('--all', default=None, action='store_true',
40 help='Runs eslint on all applicable Catapult code') 40 help='Runs eslint on all applicable Catapult code')
41 parser.add_argument('--extra-args', default=None, type=str, 41 parser.add_argument('--extra-args', default=None, type=str,
42 help='A string of extra arguments to pass to eslint') 42 help='A string of extra arguments to pass to eslint')
43 43
44 args = parser.parse_args(sys.argv[1:]) 44 args = parser.parse_args(sys.argv[1:])
45 if ((args.files is not None and args.all is not None) or 45 if ((args.paths is not None and args.all is not None) or
46 (args.files is None and args.all is None)): 46 (args.paths is None and args.all is None)):
47 print 'Either --files or --all must be used, but not both.\n' 47 print 'Either --paths or --all must be used, but not both.\n'
48 parser.print_help() 48 parser.print_help()
49 sys.exit(1) 49 sys.exit(1)
50 50
51 if args.all: 51 if args.all:
52 print eslint.RunEslintOnDirs( 52 print eslint.RunEslint(
53 DIRECTORIES_TO_LINT, extra_args=args.extra_args) 53 DIRECTORIES_TO_LINT, extra_args=args.extra_args)[0]
54 else: 54 else:
55 print eslint.RunEslintOnFiles(args.files, extra_args=args.extra_args) 55 print eslint.RunEslint(args.paths, extra_args=args.extra_args)[0]
OLDNEW
« no previous file with comments | « catapult_build/js_checks.py ('k') | common/eslint/eslint/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698