MCPcopy Create free account
hub / github.com/BVLC/caffe / CheckCompletedBlocks

Method CheckCompletedBlocks

scripts/cpp_lint.py:2176–2195  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

2174 return None
2175
2176 def CheckCompletedBlocks(self, filename, error):
2177 """Checks that all classes and namespaces have been completely parsed.
2178
2179 Call this when all lines in a file have been processed.
2180 Args:
2181 filename: The name of the current file.
2182 error: The function to call with any errors found.
2183 """
2184 # Note: This test can result in false positives if #ifdef constructs
2185 # get in the way of brace matching. See the testBuildClass test in
2186 # cpplint_unittest.py for an example of this.
2187 for obj in self.stack:
2188 if isinstance(obj, _ClassInfo):
2189 error(filename, obj.starting_linenum, 'build/class', 5,
2190 'Failed to find complete declaration of class %s' %
2191 obj.name)
2192 elif isinstance(obj, _NamespaceInfo):
2193 error(filename, obj.starting_linenum, 'build/namespaces', 5,
2194 'Failed to find complete declaration of namespace %s' %
2195 obj.name)
2196
2197
2198def CheckForNonStandardConstructs(filename, clean_lines, linenum,

Callers 1

ProcessFileDataFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected