summaryrefslogtreecommitdiffstats
path: root/tools/checklicenses
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-22 16:47:26 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-22 16:47:26 +0000
commit34a14c0e040c94e548c8e10576339c61330e910e (patch)
tree1a8b188cf71d4d69b664750d08699729a13d0344 /tools/checklicenses
parent0b51e64be2b28657fd2642c10ac24b7ba4b3cb88 (diff)
downloadchromium_src-34a14c0e040c94e548c8e10576339c61330e910e.zip
chromium_src-34a14c0e040c94e548c8e10576339c61330e910e.tar.gz
chromium_src-34a14c0e040c94e548c8e10576339c61330e910e.tar.bz2
Make it easier to remove path-specific whitelist entries
by adding a flag to ignore path-specific suppression. This will allow me to file bugs about current suppressions and just say 'run checklicenses.py --ignore-suppressions some/path to repro' BUG=28291 Review URL: http://codereview.chromium.org/7979030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102292 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/checklicenses')
-rwxr-xr-xtools/checklicenses/checklicenses.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/tools/checklicenses/checklicenses.py b/tools/checklicenses/checklicenses.py
index c5d2756..9ca97a6 100755
--- a/tools/checklicenses/checklicenses.py
+++ b/tools/checklicenses/checklicenses.py
@@ -18,6 +18,9 @@ def PrintUsage():
to the script file. This will be correct given the normal location
of the script in "<root>/tools/checklicenses".
+ --ignore-suppressions Ignores path-specific license whitelist. Useful when
+ trying to remove a suppression/whitelist entry.
+
tocheck Specifies the directory, relative to root, to check. This defaults
to "." so it checks everything.
@@ -494,14 +497,15 @@ def main(options, args):
if license in WHITELISTED_LICENSES:
continue
- found_path_specific = False
- for prefix in PATH_SPECIFIC_WHITELISTED_LICENSES:
- if (filename.startswith(prefix) and
- license in PATH_SPECIFIC_WHITELISTED_LICENSES[prefix]):
+ if not options.ignore_suppressions:
+ found_path_specific = False
+ for prefix in PATH_SPECIFIC_WHITELISTED_LICENSES:
+ if (filename.startswith(prefix) and
+ license in PATH_SPECIFIC_WHITELISTED_LICENSES[prefix]):
found_path_specific = True
break
- if found_path_specific:
- continue
+ if found_path_specific:
+ continue
print "'%s' has non-whitelisted license '%s'" % (filename, license)
success = False
@@ -532,5 +536,9 @@ if '__main__' == __name__:
'will normally be the repository root.')
option_parser.add_option('-v', '--verbose', action='store_true',
default=False, help='Print debug logging')
+ option_parser.add_option('--ignore-suppressions',
+ action='store_true',
+ default=False,
+ help='Ignore path-specific license whitelist.')
options, args = option_parser.parse_args()
main(options, args)