Checks that all classes and namespaces have been completely parsed. Call this when all lines in a file have been processed. Args: filename: The name of the current file. error: The function to call with any errors found.
(self, filename, error)
| 2759 | return None |
| 2760 | |
| 2761 | def CheckCompletedBlocks(self, filename, error): |
| 2762 | """Checks that all classes and namespaces have been completely parsed. |
| 2763 | |
| 2764 | Call this when all lines in a file have been processed. |
| 2765 | Args: |
| 2766 | filename: The name of the current file. |
| 2767 | error: The function to call with any errors found. |
| 2768 | """ |
| 2769 | # Note: This test can result in false positives if #ifdef constructs |
| 2770 | # get in the way of brace matching. See the testBuildClass test in |
| 2771 | # cpplint_unittest.py for an example of this. |
| 2772 | for obj in self.stack: |
| 2773 | if isinstance(obj, _ClassInfo): |
| 2774 | error(filename, obj.starting_linenum, 'build/class', 5, |
| 2775 | 'Failed to find complete declaration of class %s' % |
| 2776 | obj.name) |
| 2777 | elif isinstance(obj, _NamespaceInfo): |
| 2778 | error(filename, obj.starting_linenum, 'build/namespaces', 5, |
| 2779 | 'Failed to find complete declaration of namespace %s' % |
| 2780 | obj.name) |
| 2781 | |
| 2782 | |
| 2783 | def CheckForNonStandardConstructs(filename, clean_lines, linenum, |
no test coverage detected