Lint files to check that they follow the google code style.
| 374 | |
| 375 | |
| 376 | class CppLintProcessor(CacheableSourceFileProcessor): |
| 377 | """ |
| 378 | Lint files to check that they follow the google code style. |
| 379 | """ |
| 380 | |
| 381 | def __init__(self, use_cache=True): |
| 382 | super(CppLintProcessor, self).__init__( |
| 383 | use_cache=use_cache, cache_file_path='.cpplint-cache', file_type='C/C++') |
| 384 | |
| 385 | def IsRelevant(self, name): |
| 386 | return name.endswith('.cc') or name.endswith('.h') |
| 387 | |
| 388 | def IgnoreDir(self, name): |
| 389 | return (super(CppLintProcessor, self).IgnoreDir(name) |
| 390 | or (name == 'third_party')) |
| 391 | |
| 392 | IGNORE_LINT = [ |
| 393 | 'export-template.h', |
| 394 | 'flag-definitions.h', |
| 395 | 'gay-fixed.cc', |
| 396 | 'gay-precision.cc', |
| 397 | 'gay-shortest.cc', |
| 398 | ] |
| 399 | |
| 400 | def IgnoreFile(self, name): |
| 401 | return (super(CppLintProcessor, self).IgnoreFile(name) |
| 402 | or (name in CppLintProcessor.IGNORE_LINT)) |
| 403 | |
| 404 | def GetPathsToSearch(self): |
| 405 | dirs = ['include', 'samples', 'src'] |
| 406 | test_dirs = ['cctest', 'common', 'fuzzer', 'inspector', 'unittests'] |
| 407 | return dirs + [join('test', dir) for dir in test_dirs] |
| 408 | |
| 409 | def GetProcessorWorker(self): |
| 410 | return CppLintWorker |
| 411 | |
| 412 | def GetProcessorScript(self): |
| 413 | filters = ','.join([n for n in LINT_RULES]) |
| 414 | arguments = ['--filter', filters] |
| 415 | |
| 416 | cpplint = join(DEPS_DEPOT_TOOLS_PATH, 'cpplint.py') |
| 417 | return cpplint, arguments |
| 418 | |
| 419 | |
| 420 | class TorqueLintProcessor(CacheableSourceFileProcessor): |
no outgoing calls
no test coverage detected
searching dependent graphs…