Lines Matching refs:clean_lines
782 def IsInAlphabeticalOrder(self, clean_lines, linenum, header_path): argument
799 Match(r'^\s*#\s*include\b', clean_lines.elided[linenum - 1])):
1592 def CloseExpression(clean_lines, linenum, pos): argument
1615 line = clean_lines.elided[linenum]
1617 return (line, clean_lines.NumLines(), -1)
1625 while stack and linenum < clean_lines.NumLines() - 1:
1627 line = clean_lines.elided[linenum]
1633 return (line, clean_lines.NumLines(), -1)
1713 def ReverseCloseExpression(clean_lines, linenum, pos): argument
1730 line = clean_lines.elided[linenum]
1742 line = clean_lines.elided[linenum]
1880 def CheckForHeaderGuard(filename, clean_lines, error): argument
1898 raw_lines = clean_lines.lines_without_raw_strings
2046 def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, error): argument
2063 line = clean_lines.elided[linenum]
2114 def CheckPosixThreading(filename, clean_lines, linenum, error): argument
2129 line = clean_lines.elided[linenum]
2140 def CheckVlogArguments(filename, clean_lines, linenum, error): argument
2152 line = clean_lines.elided[linenum]
2164 def CheckInvalidIncrement(filename, clean_lines, linenum, error): argument
2180 line = clean_lines.elided[linenum]
2186 def IsMacroDefinition(clean_lines, linenum): argument
2187 if Search(r'^#define', clean_lines[linenum]):
2190 if linenum > 0 and Search(r'\\$', clean_lines[linenum - 1]):
2196 def IsForwardClassDeclaration(clean_lines, linenum): argument
2197 return Match(r'^\s*(\btemplate\b)*.*class\s+\w+;\s*$', clean_lines[linenum])
2210 def CheckBegin(self, filename, clean_lines, linenum, error): argument
2225 def CheckEnd(self, filename, clean_lines, linenum, error): argument
2260 def __init__(self, name, class_or_struct, clean_lines, linenum): argument
2274 self.class_indent = GetIndentLevel(clean_lines.raw_lines[linenum])
2283 for i in range(linenum, clean_lines.NumLines()):
2284 line = clean_lines.elided[i]
2290 def CheckBegin(self, filename, clean_lines, linenum, error): argument
2292 if Search('(^|[^:]):($|[^:])', clean_lines.elided[linenum]):
2295 def CheckEnd(self, filename, clean_lines, linenum, error): argument
2303 clean_lines.elided[i])
2310 if not Match(r'^\s*$', clean_lines.elided[i]):
2316 indent = Match(r'^( *)\}', clean_lines.elided[linenum])
2334 def CheckEnd(self, filename, clean_lines, linenum, error): argument
2336 line = clean_lines.raw_lines[linenum]
2468 def InTemplateArgumentList(self, clean_lines, linenum, pos): argument
2478 while linenum < clean_lines.NumLines():
2480 line = clean_lines.elided[linenum]
2512 (_, end_line, end_pos) = CloseExpression(clean_lines, linenum, pos - 1)
2577 def Update(self, filename, clean_lines, linenum, error): argument
2586 line = clean_lines.elided[linenum]
2665 if not self.InTemplateArgumentList(clean_lines, linenum, end_declaration):
2668 clean_lines, linenum))
2674 self.stack[-1].CheckBegin(filename, clean_lines, linenum, error)
2737 self.stack[-1].CheckEnd(filename, clean_lines, linenum, error)
2775 def CheckForNonStandardConstructs(filename, clean_lines, linenum, argument
2805 line = clean_lines.lines[linenum]
2823 line = clean_lines.elided[linenum]
2935 def CheckSpacingForFunctionCall(filename, clean_lines, linenum, error): argument
2944 line = clean_lines.elided[linenum]
3027 def CheckForNamespaceIndentation(filename, nesting_state, clean_lines, line, argument
3036 clean_lines.elided, line):
3037 CheckItemIndentationInNamespace(filename, clean_lines.elided,
3041 def CheckForFunctionLengths(filename, clean_lines, linenum, argument
3064 lines = clean_lines.lines
3081 for start_linenum in xrange(linenum, clean_lines.NumLines()):
3166 def CheckSpacing(filename, clean_lines, linenum, nesting_state, error): argument
3187 raw = clean_lines.lines_without_raw_strings
3208 elided = clean_lines.elided
3256 if linenum + 1 < clean_lines.NumLines():
3272 if linenum + 1 < clean_lines.NumLines():
3278 line = clean_lines.elided[linenum]
3294 def CheckOperatorSpacing(filename, clean_lines, linenum, error): argument
3303 line = clean_lines.elided[linenum]
3358 clean_lines, linenum, len(match.group(1)))
3369 clean_lines, linenum, len(match.group(1)))
3409 def CheckParenthesisSpacing(filename, clean_lines, linenum, error): argument
3418 line = clean_lines.elided[linenum]
3447 def CheckCommaSpacing(filename, clean_lines, linenum, error): argument
3456 raw = clean_lines.lines_without_raw_strings
3457 line = clean_lines.elided[linenum]
3483 def _IsType(clean_lines, nesting_state, expr): argument
3528 if clean_lines.elided[first_line].find('template') >= 0:
3539 if Search(typename_pattern, clean_lines.elided[i]):
3546 def CheckBracesSpacing(filename, clean_lines, linenum, nesting_state, error): argument
3557 line = clean_lines.elided[linenum]
3598 clean_lines, linenum, len(match.group(1)))
3603 min(endlinenum + 3, clean_lines.NumLines() - 1)):
3604 trailing_text += clean_lines.elided[offset]
3609 and not _IsType(clean_lines, nesting_state, leading_text)):
3635 def IsDecltype(clean_lines, linenum, column): argument
3645 (text, _, start_col) = ReverseCloseExpression(clean_lines, linenum, column)
3653 def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error): argument
3680 matched = Match(r'\s*(public|protected|private):', clean_lines.lines[linenum])
3690 prev_line = clean_lines.lines[linenum - 1]
3700 if Search(r'\{\s*$', clean_lines.lines[i]):
3708 def GetPreviousNonBlankLine(clean_lines, linenum): argument
3724 prevline = clean_lines.elided[prevlinenum]
3731 def CheckBraces(filename, clean_lines, linenum, error): argument
3741 line = clean_lines.elided[linenum] # get rid of comments and strings
3753 prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0]
3762 prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0]
3775 (endline, _, endpos) = CloseExpression(clean_lines, linenum, pos)
3809 (endline, endlinenum, endpos) = CloseExpression(clean_lines, linenum, pos)
3814 and endlinenum < (len(clean_lines.elided) - 1)
3815 and Match(r'\s*{', clean_lines.elided[endlinenum + 1]))):
3816 while (endlinenum < len(clean_lines.elided)
3817 and ';' not in clean_lines.elided[endlinenum][endpos:]):
3820 if endlinenum < len(clean_lines.elided):
3821 endline = clean_lines.elided[endlinenum]
3833 elif endlinenum < len(clean_lines.elided) - 1:
3835 next_line = clean_lines.elided[endlinenum + 1]
3850 def CheckTrailingSemicolon(filename, clean_lines, linenum, error): argument
3860 line = clean_lines.elided[linenum]
3936 clean_lines, linenum, closing_brace_pos)
3953 Search(r'\]\s*$', clean_lines.elided[opening_parenthesis[1] - 1])):
3969 prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0]
3976 clean_lines, linenum, len(match.group(1)))
3987 raw_lines = clean_lines.raw_lines
3997 def CheckEmptyBlockBody(filename, clean_lines, linenum, error): argument
4013 line = clean_lines.elided[linenum]
4018 clean_lines, linenum, line.find('('))
4044 if opening_linenum == len(clean_lines.elided):
4047 opening_line_fragment = clean_lines.elided[opening_linenum]
4049 opening_line = clean_lines.elided[opening_linenum]
4057 clean_lines, opening_linenum, opening_pos)
4064 if (clean_lines.raw_lines[opening_linenum] !=
4065 CleanseComments(clean_lines.raw_lines[opening_linenum])):
4072 body.extend(clean_lines.raw_lines[opening_linenum+1:closing_linenum])
4074 body.append(clean_lines.elided[closing_linenum][:closing_pos-1])
4092 if current_linenum == len(clean_lines.elided):
4094 current_line_fragment = clean_lines.elided[current_linenum]
4124 def CheckCheck(filename, clean_lines, linenum, error): argument
4135 lines = clean_lines.elided
4142 clean_lines, linenum, start_pos)
4242 def CheckAltTokens(filename, clean_lines, linenum, error): argument
4251 line = clean_lines.elided[linenum]
4296 def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state, argument
4317 raw_lines = clean_lines.lines_without_raw_strings
4340 cleansed_line = clean_lines.elided[linenum]
4351 not (clean_lines.raw_lines[linenum] != line and
4389 (GetPreviousNonBlankLine(clean_lines, linenum)[0].find('for') == -1 or
4390 GetPreviousNonBlankLine(clean_lines, linenum)[0].find(';') != -1) and
4399 CheckBraces(filename, clean_lines, linenum, error)
4400 CheckTrailingSemicolon(filename, clean_lines, linenum, error)
4401 CheckEmptyBlockBody(filename, clean_lines, linenum, error)
4402 CheckSpacing(filename, clean_lines, linenum, nesting_state, error)
4403 CheckOperatorSpacing(filename, clean_lines, linenum, error)
4404 CheckParenthesisSpacing(filename, clean_lines, linenum, error)
4405 CheckCommaSpacing(filename, clean_lines, linenum, error)
4406 CheckBracesSpacing(filename, clean_lines, linenum, nesting_state, error)
4407 CheckSpacingForFunctionCall(filename, clean_lines, linenum, error)
4408 CheckCheck(filename, clean_lines, linenum, error)
4409 CheckAltTokens(filename, clean_lines, linenum, error)
4412 CheckSectionSpacing(filename, clean_lines, classinfo, linenum, error)
4511 def CheckIncludeLine(filename, clean_lines, linenum, include_state, error): argument
4526 line = clean_lines.lines[linenum]
4578 clean_lines, linenum, canonical_include):
4670 def CheckLanguage(filename, clean_lines, linenum, file_extension, argument
4689 line = clean_lines.elided[linenum]
4695 CheckIncludeLine(filename, clean_lines, linenum, include_state, error)
4708 CheckCasts(filename, clean_lines, linenum, error)
4709 CheckGlobalStatic(filename, clean_lines, linenum, error)
4710 CheckPrintf(filename, clean_lines, linenum, error)
4828 def CheckGlobalStatic(filename, clean_lines, linenum, error): argument
4837 line = clean_lines.elided[linenum]
4840 if linenum + 1 < clean_lines.NumLines() and not Search(r'[;({]', line):
4841 line += clean_lines.elided[linenum + 1].strip()
4889 def CheckPrintf(filename, clean_lines, linenum, error): argument
4898 line = clean_lines.elided[linenum]
4918 def IsDerivedFunction(clean_lines, linenum): argument
4930 match = Match(r'^([^()]*\w+)\(', clean_lines.elided[i])
4934 clean_lines, i, len(match.group(1)))
4940 def IsOutOfLineMethodDefinition(clean_lines, linenum): argument
4951 if Match(r'^([^()]*\w+)\(', clean_lines.elided[i]):
4952 return Match(r'^[^()]*\w+::\w+\(', clean_lines.elided[i]) is not None
4956 def IsInitializerList(clean_lines, linenum): argument
4967 line = clean_lines.elided[i]
4998 def CheckForNonConstReference(filename, clean_lines, linenum, argument
5014 line = clean_lines.elided[linenum]
5021 if IsDerivedFunction(clean_lines, linenum):
5026 if IsOutOfLineMethodDefinition(clean_lines, linenum):
5050 clean_lines.elided[linenum - 1])
5054 clean_lines.elided[linenum - 1])
5062 clean_lines, linenum, endpos)
5068 line += clean_lines.elided[i].strip()
5092 previous_line = clean_lines.elided[i]
5103 if IsInitializerList(clean_lines, linenum):
5124 Search(whitelisted_functions, clean_lines.elided[linenum - i - 1])):
5137 def CheckCasts(filename, clean_lines, linenum, error): argument
5146 line = clean_lines.elided[linenum]
5156 expecting_function = ExpectingFunctionArgs(clean_lines, linenum)
5198 CheckCStyleCast(filename, clean_lines, linenum, 'static_cast',
5205 if CheckCStyleCast(filename, clean_lines, linenum, 'const_cast',
5210 CheckCStyleCast(filename, clean_lines, linenum, 'reinterpret_cast',
5234 _, y1, x1 = CloseExpression(clean_lines, linenum, len(match.group(1)))
5235 if x1 >= 0 and clean_lines.elided[y1][x1] == '(':
5236 _, y2, x2 = CloseExpression(clean_lines, y1, x1)
5238 extended_line = clean_lines.elided[y2][x2:]
5239 if y2 < clean_lines.NumLines() - 1:
5240 extended_line += clean_lines.elided[y2 + 1]
5256 def CheckCStyleCast(filename, clean_lines, linenum, cast_type, pattern, error): argument
5272 line = clean_lines.elided[linenum]
5286 context = clean_lines.elided[i] + context
5309 def ExpectingFunctionArgs(clean_lines, linenum): argument
5320 line = clean_lines.elided[linenum]
5324 clean_lines.elided[linenum - 1]) or
5326 clean_lines.elided[linenum - 2]) or
5328 clean_lines.elided[linenum - 1]))))
5483 def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error, argument
5504 for linenum in xrange(clean_lines.NumLines()):
5505 line = clean_lines.elided[linenum]
5585 def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error): argument
5597 line = clean_lines.elided[linenum]
5606 def CheckRedundantVirtual(filename, clean_lines, linenum, error): argument
5616 line = clean_lines.elided[linenum]
5640 for start_line in xrange(linenum, min(linenum + 3, clean_lines.NumLines())):
5641 line = clean_lines.elided[start_line][start_col:]
5646 clean_lines, start_line, start_col + len(parameter_list.group(1)))
5655 for i in xrange(end_line, min(end_line + 3, clean_lines.NumLines())):
5656 line = clean_lines.elided[i][end_col:]
5670 def CheckRedundantOverrideOrFinal(filename, clean_lines, linenum, error): argument
5682 line = clean_lines.elided[linenum]
5687 if linenum > 1 and clean_lines.elided[linenum - 1].rfind(')') >= 0:
5765 def ProcessLine(filename, file_extension, clean_lines, line, argument
5786 raw_lines = clean_lines.raw_lines
5788 nesting_state.Update(filename, clean_lines, line, error)
5789 CheckForNamespaceIndentation(filename, nesting_state, clean_lines, line,
5792 CheckForFunctionLengths(filename, clean_lines, line, function_state, error)
5793 CheckForMultilineCommentsAndStrings(filename, clean_lines, line, error)
5794 CheckStyle(filename, clean_lines, line, file_extension, nesting_state, error)
5795 CheckLanguage(filename, clean_lines, line, file_extension, include_state,
5797 CheckForNonConstReference(filename, clean_lines, line, nesting_state, error)
5798 CheckForNonStandardConstructs(filename, clean_lines, line,
5800 CheckVlogArguments(filename, clean_lines, line, error)
5801 CheckPosixThreading(filename, clean_lines, line, error)
5802 CheckInvalidIncrement(filename, clean_lines, line, error)
5803 CheckMakePairUsesDeduction(filename, clean_lines, line, error)
5804 CheckRedundantVirtual(filename, clean_lines, line, error)
5805 CheckRedundantOverrideOrFinal(filename, clean_lines, line, error)
5807 check_fn(filename, clean_lines, line, error)
5809 def FlagCxx11Features(filename, clean_lines, linenum, error): argument
5818 line = clean_lines.elided[linenum]
5861 def FlagCxx14Features(filename, clean_lines, linenum, error): argument
5870 line = clean_lines.elided[linenum]
5907 clean_lines = CleansedLines(lines)
5910 CheckForHeaderGuard(filename, clean_lines, error)
5912 for line in xrange(clean_lines.NumLines()):
5913 ProcessLine(filename, file_extension, clean_lines, line,
5916 FlagCxx11Features(filename, clean_lines, line, error)
5919 CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error)