Check .tq files to verify they follow the Torque style guide.
| 418 | |
| 419 | |
| 420 | class TorqueLintProcessor(CacheableSourceFileProcessor): |
| 421 | """ |
| 422 | Check .tq files to verify they follow the Torque style guide. |
| 423 | """ |
| 424 | |
| 425 | def __init__(self, use_cache=True): |
| 426 | super(TorqueLintProcessor, self).__init__( |
| 427 | use_cache=use_cache, cache_file_path='.torquelint-cache', |
| 428 | file_type='Torque') |
| 429 | |
| 430 | def IsRelevant(self, name): |
| 431 | return name.endswith('.tq') |
| 432 | |
| 433 | def GetPathsToSearch(self): |
| 434 | dirs = ['third_party', 'src'] |
| 435 | test_dirs = ['torque'] |
| 436 | return dirs + [join('test', dir) for dir in test_dirs] |
| 437 | |
| 438 | def GetProcessorWorker(self): |
| 439 | return TorqueLintWorker |
| 440 | |
| 441 | def GetProcessorScript(self): |
| 442 | torque_tools = join(TOOLS_PATH, "torque") |
| 443 | torque_path = join(torque_tools, "format-torque.py") |
| 444 | arguments = ["-il"] |
| 445 | if isfile(torque_path): |
| 446 | return torque_path, arguments |
| 447 | |
| 448 | return None, arguments |
| 449 | |
| 450 | |
| 451 | class JSLintProcessor(CacheableSourceFileProcessor): |
no outgoing calls
no test coverage detected
searching dependent graphs…