Lines Matching refs:linenum

364 def ParseNolintSuppressions(filename, raw_line, linenum, error):  argument
382 _error_suppressions.setdefault(None, set()).add(linenum)
387 _error_suppressions.setdefault(category, set()).add(linenum)
389 error(filename, linenum, 'readability/nolint', 5,
398 def IsErrorSuppressedByNolint(category, linenum): argument
410 return (linenum in _error_suppressions.get(category, set()) or
411 linenum in _error_suppressions.get(None, set()))
726 def Check(self, error, filename, linenum): argument
749 error(filename, linenum, 'readability/fn_size', error_level,
858 def _ShouldPrintError(category, confidence, linenum): argument
864 if IsErrorSuppressedByNolint(category, linenum):
885 def Error(filename, linenum, category, confidence, message): argument
907 if _ShouldPrintError(category, confidence, linenum):
911 filename, linenum, message, category, confidence))
914 filename, linenum, message, category, confidence))
917 filename, linenum, message, category, confidence))
1033 for linenum in range(len(lines)):
1034 self.lines.append(CleanseComments(lines[linenum]))
1035 elided = self._CollapseStrings(lines[linenum])
1087 def CloseExpression(clean_lines, linenum, pos): argument
1105 line = clean_lines.elided[linenum]
1116 return (line, linenum, end_pos)
1119 while linenum < clean_lines.NumLines() - 1:
1120 linenum += 1
1121 line = clean_lines.elided[linenum]
1124 return (line, linenum,
1187 for linenum, line in enumerate(lines):
1194 ifndef_linenum = linenum
1200 endif_linenum = linenum
1256 for linenum, line in enumerate(lines):
1258 error(filename, linenum, 'readability/utf8', 5,
1280 def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, error): argument
1297 line = clean_lines.elided[linenum]
1304 error(filename, linenum, 'readability/multiline_comment', 5,
1312 error(filename, linenum, 'readability/multiline_string', 5,
1335 def CheckPosixThreading(filename, clean_lines, linenum, error): argument
1350 line = clean_lines.elided[linenum]
1356 error(filename, linenum, 'runtime/threadsafe_fn', 2,
1368 def CheckInvalidIncrement(filename, clean_lines, linenum, error): argument
1384 line = clean_lines.elided[linenum]
1386 error(filename, linenum, 'runtime/invalid_increment', 5,
1398 def CheckBegin(self, filename, clean_lines, linenum, error): argument
1413 def CheckEnd(self, filename, clean_lines, linenum, error): argument
1430 def __init__(self, name, class_or_struct, clean_lines, linenum): argument
1433 self.starting_linenum = linenum
1447 for i in range(linenum, clean_lines.NumLines()):
1454 def CheckBegin(self, filename, clean_lines, linenum, error): argument
1456 if Search('(^|[^:]):($|[^:])', clean_lines.elided[linenum]):
1463 def __init__(self, name, linenum): argument
1466 self.starting_linenum = linenum
1468 def CheckEnd(self, filename, clean_lines, linenum, error): argument
1470 line = clean_lines.raw_lines[linenum]
1483 if (linenum - self.starting_linenum < 10
1504 error(filename, linenum, 'readability/namespace', 5,
1510 error(filename, linenum, 'readability/namespace', 5,
1617 def Update(self, filename, clean_lines, linenum, error): argument
1626 line = clean_lines.elided[linenum]
1666 new_namespace = _NamespaceInfo(namespace_decl_match.group(1), linenum)
1703 clean_lines, linenum))
1709 self.stack[-1].CheckBegin(filename, clean_lines, linenum, error)
1749 self.stack[-1].CheckEnd(filename, clean_lines, linenum, error)
1783 def CheckForNonStandardConstructs(filename, clean_lines, linenum, argument
1813 line = clean_lines.lines[linenum]
1816 error(filename, linenum, 'runtime/printf_format', 3,
1820 error(filename, linenum, 'runtime/printf_format', 2,
1827 error(filename, linenum, 'build/printf_format', 3,
1831 line = clean_lines.elided[linenum]
1838 error(filename, linenum, 'build/storage_class', 5,
1842 error(filename, linenum, 'build/endif_comment', 5,
1846 error(filename, linenum, 'build/forward_decl', 5,
1851 error(filename, linenum, 'build/deprecated', 3,
1862 error(filename, linenum, 'runtime/member_string_references', 2,
1886 error(filename, linenum, 'runtime/explicit', 5,
1890 def CheckSpacingForFunctionCall(filename, line, linenum, error): argument
1937 error(filename, linenum, 'whitespace/parens', 4,
1940 error(filename, linenum, 'whitespace/parens', 2,
1945 error(filename, linenum, 'whitespace/parens', 4,
1953 error(filename, linenum, 'whitespace/parens', 2,
1956 error(filename, linenum, 'whitespace/parens', 2,
1975 def CheckForFunctionLengths(filename, clean_lines, linenum, argument
1999 line = lines[linenum]
2001 raw_line = raw[linenum]
2017 for start_linenum in xrange(linenum, clean_lines.NumLines()):
2036 error(filename, linenum, 'readability/fn_size', 5,
2039 function_state.Check(error, filename, linenum)
2048 def CheckComment(comment, filename, linenum, error): argument
2062 error(filename, linenum, 'whitespace/todo', 2,
2067 error(filename, linenum, 'readability/todo', 2,
2074 error(filename, linenum, 'whitespace/todo', 2,
2077 def CheckAccess(filename, clean_lines, linenum, nesting_state, error): argument
2088 line = clean_lines.elided[linenum] # get rid of comments and strings
2097 error(filename, linenum, 'readability/constructors', 3,
2108 def FindNextMatchingAngleBracket(clean_lines, linenum, init_suffix): argument
2167 linenum += 1
2168 if linenum >= len(clean_lines.elided):
2170 line = clean_lines.elided[linenum]
2178 def FindPreviousMatchingAngleBracket(clean_lines, linenum, init_prefix): argument
2226 linenum -= 1
2227 if linenum < 0:
2229 line = clean_lines.elided[linenum]
2235 def CheckSpacing(filename, clean_lines, linenum, nesting_state, error): argument
2254 line = raw[linenum]
2270 prev_line = elided[linenum - 1]
2288 search_position = linenum-2
2306 error(filename, linenum, 'whitespace/blank_line', 2,
2316 if linenum + 1 < clean_lines.NumLines():
2317 next_line = raw[linenum + 1]
2321 error(filename, linenum, 'whitespace/blank_line', 3,
2326 error(filename, linenum, 'whitespace/blank_line', 3,
2342 error(filename, linenum, 'whitespace/comments', 2,
2358 error(filename, linenum, 'whitespace/comments', 4,
2360 CheckComment(line[commentpos:], filename, linenum, error)
2362 line = clean_lines.elided[linenum] # get rid of comments and strings
2372 error(filename, linenum, 'whitespace/operators', 4,
2385 error(filename, linenum, 'whitespace/operators', 3,
2391 error(filename, linenum, 'whitespace/operators', 3,
2403 not FindNextMatchingAngleBracket(clean_lines, linenum, match.group(1))):
2404 error(filename, linenum, 'whitespace/operators', 3,
2412 not FindPreviousMatchingAngleBracket(clean_lines, linenum,
2414 error(filename, linenum, 'whitespace/operators', 3,
2431 error(filename, linenum, 'whitespace/operators', 3,
2437 error(filename, linenum, 'whitespace/operators', 4,
2443 error(filename, linenum, 'whitespace/parens', 5,
2459 error(filename, linenum, 'whitespace/parens', 5,
2462 error(filename, linenum, 'whitespace/parens', 5,
2468 error(filename, linenum, 'whitespace/comma', 3,
2476 error(filename, linenum, 'whitespace/semicolon', 3,
2480 CheckSpacingForFunctionCall(filename, line, linenum, error)
2487 error(filename, linenum, 'whitespace/braces', 5,
2492 error(filename, linenum, 'whitespace/braces', 5,
2498 error(filename, linenum, 'whitespace/braces', 5,
2505 error(filename, linenum, 'whitespace/semicolon', 5,
2508 error(filename, linenum, 'whitespace/semicolon', 5,
2513 error(filename, linenum, 'whitespace/semicolon', 5,
2521 error(filename, linenum, 'whitespace/forcolon', 2,
2525 def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error): argument
2549 linenum <= class_info.starting_linenum):
2552 matched = Match(r'\s*(public|protected|private):', clean_lines.lines[linenum])
2562 prev_line = clean_lines.lines[linenum - 1]
2571 for i in range(class_info.starting_linenum, linenum):
2575 if end_class_head < linenum - 1:
2576 error(filename, linenum, 'whitespace/blank_line', 3,
2580 def GetPreviousNonBlankLine(clean_lines, linenum): argument
2594 prevlinenum = linenum - 1
2603 def CheckBraces(filename, clean_lines, linenum, error): argument
2613 line = clean_lines.elided[linenum] # get rid of comments and strings
2623 prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0]
2626 error(filename, linenum, 'whitespace/braces', 4,
2631 prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0]
2633 error(filename, linenum, 'whitespace/newline', 4,
2644 (endline, _, endpos) = CloseExpression(clean_lines, linenum, pos)
2646 error(filename, linenum, 'readability/braces', 5,
2649 error(filename, linenum, 'readability/braces', 5,
2654 error(filename, linenum, 'whitespace/newline', 4,
2659 error(filename, linenum, 'whitespace/newline', 4,
2665 prevlinenum = linenum
2675 error(filename, linenum, 'readability/braces', 4,
2679 def CheckEmptyLoopBody(filename, clean_lines, linenum, error): argument
2692 line = clean_lines.elided[linenum]
2696 clean_lines, linenum, line.find('('))
2741 def CheckCheck(filename, clean_lines, linenum, error): argument
2755 if raw_lines[linenum].find(macro) >= 0:
2762 line = clean_lines.elided[linenum] # get rid of comments and strings
2767 error(filename, linenum, 'readability/check', 2,
2774 def CheckAltTokens(filename, clean_lines, linenum, error): argument
2783 line = clean_lines.elided[linenum]
2801 error(filename, linenum, 'readability/alt_tokens', 2,
2828 def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state, argument
2847 line = raw_lines[linenum]
2850 error(filename, linenum, 'whitespace/tab', 1,
2866 cleansed_line = clean_lines.elided[linenum]
2870 error(filename, linenum, 'whitespace/end_of_line', 4,
2875 error(filename, linenum, 'whitespace/indent', 3,
2881 error(filename, linenum, 'whitespace/labels', 4,
2909 error(filename, linenum, 'whitespace/line_length', 4,
2912 error(filename, linenum, 'whitespace/line_length', 2,
2918 (GetPreviousNonBlankLine(clean_lines, linenum)[0].find('for') == -1 or
2919 GetPreviousNonBlankLine(clean_lines, linenum)[0].find(';') != -1) and
2924 error(filename, linenum, 'whitespace/newline', 0,
2928 CheckBraces(filename, clean_lines, linenum, error)
2929 CheckEmptyLoopBody(filename, clean_lines, linenum, error)
2930 CheckAccess(filename, clean_lines, linenum, nesting_state, error)
2931 CheckSpacing(filename, clean_lines, linenum, nesting_state, error)
2932 CheckCheck(filename, clean_lines, linenum, error)
2933 CheckAltTokens(filename, clean_lines, linenum, error)
2936 CheckSectionSpacing(filename, clean_lines, classinfo, linenum, error)
3054 def CheckIncludeLine(filename, clean_lines, linenum, include_state, error): argument
3070 line = clean_lines.lines[linenum]
3074 error(filename, linenum, 'build/include', 4,
3085 error(filename, linenum, 'build/include', 4,
3089 include_state[include] = linenum
3105 error(filename, linenum, 'build/include_order', 4,
3109 error(filename, linenum, 'build/include_alpha', 4,
3119 error(filename, linenum, 'readability/streams', 3,
3179 def CheckLanguage(filename, clean_lines, linenum, file_extension, include_state, argument
3196 line = clean_lines.elided[linenum]
3202 CheckIncludeLine(filename, clean_lines, linenum, include_state, error)
3208 if linenum + 1 < clean_lines.NumLines():
3209 extended_line = line + clean_lines.elided[linenum + 1]
3239 error(filename, linenum, 'runtime/references', 2,
3272 if (linenum == 0 or
3274 clean_lines.elided[linenum - 1])):
3275 error(filename, linenum, 'readability/casting', 4,
3280 CheckCStyleCast(filename, linenum, line, clean_lines.raw_lines[linenum],
3288 if CheckCStyleCast(filename, linenum, line, clean_lines.raw_lines[linenum],
3293 CheckCStyleCast(filename, linenum, line, clean_lines.raw_lines[linenum],
3301 error(filename, linenum, 'runtime/casting', 4,
3317 error(filename, linenum, 'runtime/string', 4,
3324 error(filename, linenum, 'runtime/rtti', 5,
3330 error(filename, linenum, 'runtime/init', 4,
3345 error(filename, linenum, 'runtime/int', 4,
3350 error(filename, linenum, 'runtime/int', 4,
3357 error(filename, linenum, 'runtime/printf', 3,
3363 error(filename, linenum, 'runtime/printf', 5,
3367 error(filename, linenum, 'runtime/printf', 4,
3371 error(filename, linenum, 'runtime/printf', 1,
3381 error(filename, linenum, 'runtime/operator', 4,
3387 error(filename, linenum, 'readability/braces', 4,
3403 error(filename, linenum, 'runtime/printf', 4,
3410 error(filename, linenum, 'runtime/memset', 4,
3415 error(filename, linenum, 'build/namespaces', 5,
3454 error(filename, linenum, 'runtime/arrays', 1,
3466 if match and linenum + 1 < clean_lines.NumLines():
3467 next_line = clean_lines.elided[linenum + 1]
3475 error(filename, linenum, 'readability/constructors', 3,
3484 error(filename, linenum, 'build/namespaces', 4,
3490 def CheckCStyleCast(filename, linenum, line, raw_line, cast_type, pattern, argument
3517 error(filename, linenum, 'runtime/sizeof', 1,
3546 error(filename, linenum, 'readability/function', 3,
3551 error(filename, linenum, 'readability/casting', 4,
3687 linenum = 0
3689 linenum += 1
3696 include_state.setdefault(include, '%s:%d' % (filename, linenum))
3721 for linenum in xrange(clean_lines.NumLines()):
3722 line = clean_lines.elided[linenum]
3733 required['<string>'] = (linenum, 'string')
3737 required[header] = (linenum, template)
3745 required[header] = (linenum, template)
3796 def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error): argument
3809 line = raw[linenum]
3812 error(filename, linenum, 'build/explicit_make_pair',
3942 for linenum in range(len(lines)):
3943 if lines[linenum].endswith('\r'):
3944 lines[linenum] = lines[linenum].rstrip('\r')