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

Side by Side Diff: tools/code_hygiene.py

Issue 11413049: Suppress pychecker warnings about the python standard library (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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/python 1 #!/usr/bin/python
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. 2 # Copyright (c) 2012 The Native Client 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 """Simple Code Hygiene tool meant to be run as a presubmit test or standalone 6 """Simple Code Hygiene tool meant to be run as a presubmit test or standalone
7 7
8 Usage: 8 Usage:
9 ./code_hygiene.py <file1> <file2> ... 9 ./code_hygiene.py <file1> <file2> ...
10 10
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 ',-build/include_order' 51 ',-build/include_order'
52 ',-readability/casting' 52 ',-readability/casting'
53 ',-readability/check' 53 ',-readability/check'
54 ',-readability/multiline_comment' 54 ',-readability/multiline_comment'
55 ',-runtime/sizeof' 55 ',-runtime/sizeof'
56 ',-runtime/threadsafe_fn' 56 ',-runtime/threadsafe_fn'
57 ',-whitespace/newline' 57 ',-whitespace/newline'
58 ] 58 ]
59 59
60 # http://pychecker.sourceforge.net/ 60 # http://pychecker.sourceforge.net/
61 PYTHON_CHECKER = ['pychecker'] 61 PYTHON_CHECKER = ['pychecker', '-stdlib']
62 62
63 RE_IGNORE = re.compile(r'@IGNORE_LINES_FOR_CODE_HYGIENE\[([0-9]+)\]') 63 RE_IGNORE = re.compile(r'@IGNORE_LINES_FOR_CODE_HYGIENE\[([0-9]+)\]')
64 64
65 # ====================================================================== 65 # ======================================================================
66 def Debug(s): 66 def Debug(s):
67 if VERBOSE: 67 if VERBOSE:
68 print s 68 print s
69 69
70 70
71 def RunCommand(cmd): 71 def RunCommand(cmd):
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 num_error += 1 554 num_error += 1
555 continue 555 continue
556 556
557 errors, warnings = CheckFile(filename, True) 557 errors, warnings = CheckFile(filename, True)
558 if errors: 558 if errors:
559 num_error += 1 559 num_error += 1
560 return num_error 560 return num_error
561 561
562 if __name__ == '__main__': 562 if __name__ == '__main__':
563 sys.exit(main(sys.argv[1:])) 563 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698