Commit 65087588 authored by mnaganov's avatar mnaganov Committed by Commit bot

Add a note about false positives on "copyright" word into licenses checker

It is required to scan the entire file for potential copyright references,
as third-party code may appear anywhere in the file, so false positives
are unfortunately inevitable for comments containing the "C-word".

Add a note to the scanner message to provide a hint on that.

BUG=243570
TBR=torne@chromium.org

Review URL: https://codereview.chromium.org/1161943005

Cr-Commit-Position: refs/heads/master@{#333124}
parent dbdcceb6
......@@ -376,8 +376,11 @@ def ScanAtPresubmit(input_api, output_api):
results.append(output_api.PresubmitError(
'The following files contain a third-party license but are not in ' \
'a listed third-party directory and are not whitelisted. You must ' \
'add the following files to the whitelist file ' \
'%s:' % _GetWhitelistFileName(input_api),
'add the following files to the whitelist file %s\n' \
'(Note that if the code you are adding does not actually contain ' \
'any third-party code, it may contain the word "copyright", which ' \
'should be masked out, e.g. by writing it as "copy-right"):' \
'' % _GetWhitelistFileName(input_api),
sorted(unknown_files)))
if missing_files:
results.append(output_api.PresubmitPromptWarning(
......
......@@ -97,11 +97,14 @@ def _CheckLicenseHeaders(excluded_dirs_list, whitelisted_files):
if unknown:
print 'The following files contain a third-party license but are not in ' \
'a listed third-party directory and are not whitelisted. You must ' \
'add the following files to the whitelist.\n%s' % \
'add the following files to the whitelist.\n' \
'(Note that if the code you are adding does not actually contain ' \
'any third-party code, it may contain the word "copyright", which ' \
'should be masked out, e.g. by writing it as "copy-right")\n%s' % \
'\n'.join(sorted(unknown))
if missing:
print 'The following files are whitelisted, but do not exist.\n%s' % \
'\n'.join(sorted(missing))
'\n'.join(sorted(missing))
if stale:
print 'The following files are whitelisted unnecessarily. You must ' \
'remove the following files from the whitelist.\n%s' % \
......
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