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

Method PerformLanguageRulesCheck

cpplint_unittest.py:182–194  ·  view source on GitHub ↗
(self, file_name, code)

Source from the content-addressed store, hash-verified

180 # Similar to PerformMultiLineLint, but calls CheckLanguage instead of
181 # CheckForNonStandardConstructs
182 def PerformLanguageRulesCheck(self, file_name, code):
183 error_collector = ErrorCollector(self.assertTrue)
184 include_state = cpplint._IncludeState()
185 nesting_state = cpplint.NestingState()
186 lines = code.split("\n")
187 cpplint.RemoveMultiLineComments(file_name, lines, error_collector)
188 lines = cpplint.CleansedLines(lines)
189 ext = file_name[file_name.rfind(".") + 1 :]
190 for i in range(lines.NumLines()):
191 cpplint.CheckLanguage(
192 file_name, lines, i, ext, include_state, nesting_state, error_collector
193 )
194 return error_collector.Results()
195
196 def PerformFunctionLengthsCheck(self, code):
197 """Perform Lint function length check on block of code and return warnings.

Callers 1

Calls 3

NumLinesMethod · 0.95
ResultsMethod · 0.95
ErrorCollectorClass · 0.85

Tested by

no test coverage detected