mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
presubmit_canned_checks: hack to avoid analyzer triggers
The analyzer is finding these literal strings and putting error messages into new CLs. Hack the string up to avoid that. Change-Id: I8335e6f5e29ca4c2257010629f46036bc250ff73 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6147794 Reviewed-by: Yiwei Zhang <yiwzhang@google.com> Commit-Queue: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
@@ -597,25 +597,32 @@ def CheckLongLines(input_api, output_api, maxlen, source_file_filter=None):
|
||||
'': maxlen,
|
||||
}
|
||||
|
||||
# To avoid triggering on the magic string, break it up.
|
||||
LINT_THEN_CHANGE_EXCEPTION = ('LI'
|
||||
'NT.ThenChange(')
|
||||
|
||||
# Language specific exceptions to max line length.
|
||||
# '.h' is considered an obj-c file extension, since OBJC_EXCEPTIONS are a
|
||||
# superset of CPP_EXCEPTIONS.
|
||||
CPP_FILE_EXTS = ('c', 'cc')
|
||||
CPP_EXCEPTIONS = ('#define', '#endif', '#if', '#include', '#pragma',
|
||||
'// LINT.ThenChange(')
|
||||
'// ' + LINT_THEN_CHANGE_EXCEPTION)
|
||||
HTML_FILE_EXTS = ('html', )
|
||||
HTML_EXCEPTIONS = ('<g ', '<link ', '<path ', '<!-- LINT.ThenChange(')
|
||||
HTML_EXCEPTIONS = ('<g ', '<link ', '<path ',
|
||||
'<!-- ' + LINT_THEN_CHANGE_EXCEPTION)
|
||||
JAVA_FILE_EXTS = ('java', )
|
||||
JAVA_EXCEPTIONS = ('import ', 'package ', '// LINT.ThenChange(')
|
||||
JAVA_EXCEPTIONS = ('import ', 'package ',
|
||||
'// ' + LINT_THEN_CHANGE_EXCEPTION)
|
||||
JS_FILE_EXTS = ('js', )
|
||||
JS_EXCEPTIONS = ("GEN('#include", 'import ', '// LINT.ThenChange(')
|
||||
JS_EXCEPTIONS = ("GEN('#include", 'import ',
|
||||
'// ' + LINT_THEN_CHANGE_EXCEPTION)
|
||||
TS_FILE_EXTS = ('ts', )
|
||||
TS_EXCEPTIONS = ('import ', '// LINT.ThenChange(')
|
||||
TS_EXCEPTIONS = ('import ', '// ' + LINT_THEN_CHANGE_EXCEPTION)
|
||||
OBJC_FILE_EXTS = ('h', 'm', 'mm')
|
||||
OBJC_EXCEPTIONS = ('#define', '#endif', '#if', '#import', '#include',
|
||||
'#pragma', '// LINT.ThenChange(')
|
||||
'#pragma', '// ' + LINT_THEN_CHANGE_EXCEPTION)
|
||||
PY_FILE_EXTS = ('py', )
|
||||
PY_EXCEPTIONS = ('import', 'from', '# LINT.ThenChange(')
|
||||
PY_EXCEPTIONS = ('import', 'from', '# ' + LINT_THEN_CHANGE_EXCEPTION)
|
||||
|
||||
LANGUAGE_EXCEPTIONS = [
|
||||
(CPP_FILE_EXTS, CPP_EXCEPTIONS),
|
||||
|
||||
Reference in New Issue
Block a user