MCPcopy Index your code
hub / github.com/cpplint/cpplint / GetBuildHeaderGuardPreprocessorSymbol

Method GetBuildHeaderGuardPreprocessorSymbol

cpplint_unittest.py:5186–5196  ·  view source on GitHub ↗
(self, file_path)

Source from the content-addressed store, hash-verified

5184 )
5185
5186 def GetBuildHeaderGuardPreprocessorSymbol(self, file_path):
5187 # Figure out the expected header guard by processing an empty file.
5188 error_collector = ErrorCollector(self.assertTrue)
5189 cpplint.ProcessFileData(file_path, "h", [], error_collector)
5190 for error in error_collector.ResultList():
5191 matched = re.search(
5192 "No #ifndef header guard found, suggested CPP variable is: ([A-Z0-9_]+)", error
5193 )
5194 if matched is not None:
5195 return matched.group(1)
5196 return None
5197
5198 def testBuildHeaderGuard(self):
5199 file_path = "mydir/foo.h"

Callers 1

testBuildHeaderGuardMethod · 0.95

Calls 2

ResultListMethod · 0.95
ErrorCollectorClass · 0.85

Tested by

no test coverage detected