Commit 9a529b12 authored by Tamer Tas's avatar Tamer Tas Committed by Commit Bot

[test] reformat and rename presubmit checks

R=sergiyb@chromium.org

No-Try: true
Change-Id: I94937b6852c8e7e8aece3b67eb1c2a79dbf71c25
Reviewed-on: https://chromium-review.googlesource.com/c/1392193
Commit-Queue: Tamer Tas <tmrts@chromium.org>
Reviewed-by: 's avatarSergiy Belozorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58671}
parent 5e725a2b
...@@ -74,7 +74,7 @@ def _V8PresubmitChecks(input_api, output_api): ...@@ -74,7 +74,7 @@ def _V8PresubmitChecks(input_api, output_api):
sys.path.append(input_api.os_path.join( sys.path.append(input_api.os_path.join(
input_api.PresubmitLocalPath(), 'tools')) input_api.PresubmitLocalPath(), 'tools'))
from v8_presubmit import CppLintProcessor from v8_presubmit import CppLintProcessor
from v8_presubmit import TorqueFormatProcessor from v8_presubmit import TorqueLintProcessor
from v8_presubmit import SourceProcessor from v8_presubmit import SourceProcessor
from v8_presubmit import StatusFilesProcessor from v8_presubmit import StatusFilesProcessor
...@@ -93,7 +93,7 @@ def _V8PresubmitChecks(input_api, output_api): ...@@ -93,7 +93,7 @@ def _V8PresubmitChecks(input_api, output_api):
if not CppLintProcessor().RunOnFiles( if not CppLintProcessor().RunOnFiles(
input_api.AffectedFiles(file_filter=FilterFile, include_deletes=False)): input_api.AffectedFiles(file_filter=FilterFile, include_deletes=False)):
results.append(output_api.PresubmitError("C++ lint check failed")) results.append(output_api.PresubmitError("C++ lint check failed"))
if not TorqueFormatProcessor().RunOnFiles( if not TorqueLintProcessor().RunOnFiles(
input_api.AffectedFiles(file_filter=FilterTorqueFile, input_api.AffectedFiles(file_filter=FilterTorqueFile,
include_deletes=False)): include_deletes=False)):
results.append(output_api.PresubmitError("Torque format check failed")) results.append(output_api.PresubmitError("Torque format check failed"))
......
...@@ -347,14 +347,15 @@ class CppLintProcessor(CacheableSourceFileProcessor): ...@@ -347,14 +347,15 @@ class CppLintProcessor(CacheableSourceFileProcessor):
return None, arguments return None, arguments
class TorqueFormatProcessor(CacheableSourceFileProcessor): class TorqueLintProcessor(CacheableSourceFileProcessor):
""" """
Check .tq files to verify they follow the Torque style guide. Check .tq files to verify they follow the Torque style guide.
""" """
def __init__(self, use_cache=True): def __init__(self, use_cache=True):
super(TorqueFormatProcessor, self).__init__( super(TorqueLintProcessor, self).__init__(
use_cache=use_cache, cache_file_path='.torquelint-cache', file_type='Torque') use_cache=use_cache, cache_file_path='.torquelint-cache',
file_type='Torque')
def IsRelevant(self, name): def IsRelevant(self, name):
return name.endswith('.tq') return name.endswith('.tq')
...@@ -663,8 +664,8 @@ def GetOptions(): ...@@ -663,8 +664,8 @@ def GetOptions():
result = optparse.OptionParser() result = optparse.OptionParser()
result.add_option('--no-lint', help="Do not run cpplint", default=False, result.add_option('--no-lint', help="Do not run cpplint", default=False,
action="store_true") action="store_true")
result.add_option('--no-linter-cache', help="Do not cache linter results", default=False, result.add_option('--no-linter-cache', help="Do not cache linter results",
action="store_true") default=False, action="store_true")
return result return result
...@@ -682,7 +683,8 @@ def Main(): ...@@ -682,7 +683,8 @@ def Main():
success &= CppLintProcessor(use_cache=use_linter_cache).RunOnPath(workspace) success &= CppLintProcessor(use_cache=use_linter_cache).RunOnPath(workspace)
print "Running Torque formatting check..." print "Running Torque formatting check..."
success &= TorqueFormatProcessor(use_cache=use_linter_cache).RunOnPath(workspace) success &= TorqueLintProcessor(use_cache=use_linter_cache).RunOnPath(
workspace)
print "Running copyright header, trailing whitespaces and " \ print "Running copyright header, trailing whitespaces and " \
"two empty lines between declarations check..." "two empty lines between declarations check..."
success &= SourceProcessor().RunOnPath(workspace) success &= SourceProcessor().RunOnPath(workspace)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment