| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # | 2 # |
| 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """ Lint for IDL """ | 7 """ Lint for IDL """ |
| 8 | 8 |
| 9 import os | 9 import os |
| 10 import sys | 10 import sys |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 if pbv != ret: | 57 if pbv != ret: |
| 58 node.Warning('%s passByValue but %s returnByValue.' % (pbv, ret)) | 58 node.Warning('%s passByValue but %s returnByValue.' % (pbv, ret)) |
| 59 warnings += 1 | 59 warnings += 1 |
| 60 | 60 |
| 61 if node.IsA('EnumItem'): | 61 if node.IsA('EnumItem'): |
| 62 if not node.GetProperty('VALUE') and not node.GetProperty('wenum'): | 62 if not node.GetProperty('VALUE') and not node.GetProperty('wenum'): |
| 63 node.Warning('Expecting value for enumeration.') | 63 node.Warning('Expecting value for enumeration.') |
| 64 warnings += 1 | 64 warnings += 1 |
| 65 | 65 |
| 66 if node.IsA('Interface'): | 66 if node.IsA('Interface'): |
| 67 if not node.GetLabel(): | |
| 68 node.Warning('Expecting label.') | |
| 69 warnings += 1 | |
| 70 macro = node.GetProperty('macro') | 67 macro = node.GetProperty('macro') |
| 71 if macro and not node.GetProperty('wname'): | 68 if macro and not node.GetProperty('wname'): |
| 72 node.Warning('Interface name inconsistent: %s' % macro) | 69 node.Warning('Interface name inconsistent: %s' % macro) |
| 73 warnings += 1 | 70 warnings += 1 |
| 74 | 71 |
| 75 if node.IsA('Inline') and not node.GetProperty('winline'): | 72 if node.IsA('Inline') and not node.GetProperty('winline'): |
| 76 inline_type = node.GetProperty('NAME') | 73 inline_type = node.GetProperty('NAME') |
| 77 node.parent.Warning('Requires an inline %s block.' % inline_type) | 74 node.parent.Warning('Requires an inline %s block.' % inline_type) |
| 78 warnings += 1 | 75 warnings += 1 |
| 79 | 76 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 name = filenode.GetProperty('NAME') | 110 name = filenode.GetProperty('NAME') |
| 114 if filenode.GetProperty('ERRORS') > 0: | 111 if filenode.GetProperty('ERRORS') > 0: |
| 115 ErrOut.Log('%s : Skipped due to errors.' % name) | 112 ErrOut.Log('%s : Skipped due to errors.' % name) |
| 116 skipList.append(filenode) | 113 skipList.append(filenode) |
| 117 continue | 114 continue |
| 118 warnings = IDLLinter().Visit(filenode, 0) | 115 warnings = IDLLinter().Visit(filenode, 0) |
| 119 if warnings: | 116 if warnings: |
| 120 WarnOut.Log('%s warning(s) for %s\n' % (warnings, name)) | 117 WarnOut.Log('%s warning(s) for %s\n' % (warnings, name)) |
| 121 return skipList | 118 return skipList |
| 122 | 119 |
| OLD | NEW |