diff options
author | noelallen@google.com <noelallen@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-22 22:18:27 +0000 |
---|---|---|
committer | noelallen@google.com <noelallen@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-22 22:18:27 +0000 |
commit | fb94d1bf4084dbcd152d6ff0efc4ac774a794e14 (patch) | |
tree | 9eb6961ff1ef254911e00e63273506f12b71fc8c /ppapi/generators | |
parent | b670a41eb7c077adac3889df61f57710e29920bf (diff) | |
download | chromium_src-fb94d1bf4084dbcd152d6ff0efc4ac774a794e14.zip chromium_src-fb94d1bf4084dbcd152d6ff0efc4ac774a794e14.tar.gz chromium_src-fb94d1bf4084dbcd152d6ff0efc4ac774a794e14.tar.bz2 |
Minor change to IDL lint
Add more switches for turning off warnings.
Add -wnone to disable all warnings.
BUG= none
TEST= python idl_c_header.py
Review URL: http://codereview.chromium.org/7669066
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97754 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/generators')
-rw-r--r-- | ppapi/generators/idl_lint.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/ppapi/generators/idl_lint.py b/ppapi/generators/idl_lint.py index 3f06902..c5f1a3f 100644 --- a/ppapi/generators/idl_lint.py +++ b/ppapi/generators/idl_lint.py @@ -20,6 +20,8 @@ from idl_visitor import IDLVisitor Option('wcomment', 'Disable warning for missing comment.') Option('wenum', 'Disable warning for missing enum value.') Option('winline', 'Disable warning for inline blocks.') +Option('wname', 'Disable warning for inconsistent interface name.') +Option('wnone', 'Disable all warnings.') Option('wparam', 'Disable warning for missing [in|out|inout] on param.') Option('wpass', 'Disable warning for mixed passByValue and returnByValue.') @@ -66,7 +68,7 @@ class IDLLinter(IDLVisitor): node.Warning('Expecting label.') warnings += 1 macro = node.GetProperty('macro') - if macro: + if macro and not node.GetProperty('wname'): node.Warning('Interface name inconsistent: %s' % macro) warnings += 1 @@ -75,7 +77,7 @@ class IDLLinter(IDLVisitor): node.parent.Warning('Requires an inline %s block.' % inline_type) warnings += 1 - if node.IsA('Callspec'): + if node.IsA('Callspec') and not node.GetProperty('wparam'): out = False for arg in node.GetListOf('Param'): if arg.GetProperty('out'): @@ -101,11 +103,10 @@ class IDLLinter(IDLVisitor): return warnings def Lint(ast): - if GetOption('wcomment'): ast.SetProperty('wcomment', True) - if GetOption('wenum'): ast.SetProperty('wenum', True) - if GetOption('winline'): ast.SetProperty('winilne', True) - if GetOption('wparam'): ast.SetProperty('wparam', True) - if GetOption('wpass'): ast.SetProperty('wpass', True) + options = ['wcomment', 'wenum', 'winline', 'wparam', 'wpass', 'wname'] + wnone = GetOption('wnone') + for opt in options: + if wnone or GetOption(opt): ast.SetProperty(opt, True) skipList = [] for filenode in ast.GetListOf('File'): @@ -118,3 +119,4 @@ def Lint(ast): if warnings: WarnOut.Log('%s warning(s) for %s\n' % (warnings, name)) return skipList + |