OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2012 the V8 project authors. All rights reserved. | 3 # Copyright 2012 the V8 project authors. All rights reserved. |
4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
6 # met: | 6 # met: |
7 # | 7 # |
8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 185 |
186 class CppLintProcessor(SourceFileProcessor): | 186 class CppLintProcessor(SourceFileProcessor): |
187 """ | 187 """ |
188 Lint files to check that they follow the google code style. | 188 Lint files to check that they follow the google code style. |
189 """ | 189 """ |
190 | 190 |
191 def IsRelevant(self, name): | 191 def IsRelevant(self, name): |
192 return name.endswith('.cc') or name.endswith('.h') | 192 return name.endswith('.cc') or name.endswith('.h') |
193 | 193 |
194 def IgnoreDir(self, name): | 194 def IgnoreDir(self, name): |
| 195 # TODO(dgozman): remove inspector after fixing the issues. |
195 return (super(CppLintProcessor, self).IgnoreDir(name) | 196 return (super(CppLintProcessor, self).IgnoreDir(name) |
196 or (name == 'third_party')) | 197 or (name == 'third_party') or (name == 'inspector')) |
197 | 198 |
198 IGNORE_LINT = ['flag-definitions.h'] | 199 IGNORE_LINT = ['flag-definitions.h'] |
199 | 200 |
200 def IgnoreFile(self, name): | 201 def IgnoreFile(self, name): |
201 return (super(CppLintProcessor, self).IgnoreFile(name) | 202 return (super(CppLintProcessor, self).IgnoreFile(name) |
202 or (name in CppLintProcessor.IGNORE_LINT)) | 203 or (name in CppLintProcessor.IGNORE_LINT)) |
203 | 204 |
204 def GetPathsToSearch(self): | 205 def GetPathsToSearch(self): |
205 return ['src', 'include', 'samples', join('test', 'cctest'), | 206 return ['src', 'include', 'samples', join('test', 'cctest'), |
206 join('test', 'unittests')] | 207 join('test', 'unittests')] |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 def IgnoreDir(self, name): | 293 def IgnoreDir(self, name): |
293 return (super(SourceProcessor, self).IgnoreDir(name) or | 294 return (super(SourceProcessor, self).IgnoreDir(name) or |
294 name in ('third_party', 'gyp', 'out', 'obj', 'DerivedSources')) | 295 name in ('third_party', 'gyp', 'out', 'obj', 'DerivedSources')) |
295 | 296 |
296 IGNORE_COPYRIGHTS = ['box2d.js', | 297 IGNORE_COPYRIGHTS = ['box2d.js', |
297 'cpplint.py', | 298 'cpplint.py', |
298 'copy.js', | 299 'copy.js', |
299 'corrections.js', | 300 'corrections.js', |
300 'crypto.js', | 301 'crypto.js', |
301 'daemon.py', | 302 'daemon.py', |
| 303 'DebuggerScript.js', |
302 'earley-boyer.js', | 304 'earley-boyer.js', |
303 'fannkuch.js', | 305 'fannkuch.js', |
304 'fasta.js', | 306 'fasta.js', |
| 307 'InjectedScript.cpp', |
| 308 'InjectedScript.h', |
| 309 'InjectedScriptSource.js', |
| 310 'JavaScriptCallFrame.cpp', |
| 311 'JavaScriptCallFrame.h', |
305 'jsmin.py', | 312 'jsmin.py', |
306 'libraries.cc', | 313 'libraries.cc', |
307 'libraries-empty.cc', | 314 'libraries-empty.cc', |
308 'lua_binarytrees.js', | 315 'lua_binarytrees.js', |
309 'memops.js', | 316 'memops.js', |
310 'poppler.js', | 317 'poppler.js', |
311 'primes.js', | 318 'primes.js', |
312 'raytrace.js', | 319 'raytrace.js', |
313 'regexp-pcre.js', | 320 'regexp-pcre.js', |
| 321 'rjsmin.py', |
| 322 'ScriptBreakpoint.h', |
314 'sqlite.js', | 323 'sqlite.js', |
315 'sqlite-change-heap.js', | 324 'sqlite-change-heap.js', |
316 'sqlite-pointer-masking.js', | 325 'sqlite-pointer-masking.js', |
317 'sqlite-safe-heap.js', | 326 'sqlite-safe-heap.js', |
| 327 'V8DebuggerScript.h', |
| 328 'V8FunctionCall.cpp', |
| 329 'V8FunctionCall.h', |
| 330 'V8InspectorImpl.cpp', |
| 331 'V8InspectorImpl.h', |
| 332 'V8RuntimeAgentImpl.cpp', |
| 333 'V8RuntimeAgentImpl.h', |
318 'gnuplot-4.6.3-emscripten.js', | 334 'gnuplot-4.6.3-emscripten.js', |
319 'zlib.js'] | 335 'zlib.js'] |
320 IGNORE_TABS = IGNORE_COPYRIGHTS + ['unicode-test.js', 'html-comments.js'] | 336 IGNORE_TABS = IGNORE_COPYRIGHTS + ['unicode-test.js', 'html-comments.js'] |
321 | 337 |
322 def EndOfDeclaration(self, line): | 338 def EndOfDeclaration(self, line): |
323 return line == "}" or line == "};" | 339 return line == "}" or line == "};" |
324 | 340 |
325 def StartOfDeclaration(self, line): | 341 def StartOfDeclaration(self, line): |
326 return line.find("//") == 0 or \ | 342 return line.find("//") == 0 or \ |
327 line.find("/*") == 0 or \ | 343 line.find("/*") == 0 or \ |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 success &= CheckExternalReferenceRegistration(workspace) | 505 success &= CheckExternalReferenceRegistration(workspace) |
490 success &= CheckStatusFiles(workspace) | 506 success &= CheckStatusFiles(workspace) |
491 if success: | 507 if success: |
492 return 0 | 508 return 0 |
493 else: | 509 else: |
494 return 1 | 510 return 1 |
495 | 511 |
496 | 512 |
497 if __name__ == '__main__': | 513 if __name__ == '__main__': |
498 sys.exit(Main()) | 514 sys.exit(Main()) |
OLD | NEW |