Lines Matching full:linenum
360 def ParseNolintSuppressions(filename, raw_line, linenum, error): argument
370 linenum: int, the number of the current line.
378 _error_suppressions.setdefault(None, set()).add(linenum)
383 _error_suppressions.setdefault(category, set()).add(linenum)
385 error(filename, linenum, 'readability/nolint', 5,
394 def IsErrorSuppressedByNolint(category, linenum): argument
402 linenum: int, the current line number.
406 return (linenum in _error_suppressions.get(category, set()) or
407 linenum in _error_suppressions.get(None, set()))
700 def Check(self, error, filename, linenum): argument
706 linenum: The number of the line to check.
719 error(filename, linenum, 'readability/fn_size', error_level,
825 def _ShouldPrintError(category, confidence, linenum): argument
831 if IsErrorSuppressedByNolint(category, linenum):
852 def Error(filename, linenum, category, confidence, message): argument
865 linenum: The number of the line containing the error.
874 if _ShouldPrintError(category, confidence, linenum):
878 filename, linenum, message, category, confidence))
881 filename, linenum, message, category, confidence))
884 filename, linenum, message, category, confidence))
1000 for linenum in range(len(lines)):
1001 self.lines.append(CleanseComments(lines[linenum]))
1002 elided = self._CollapseStrings(lines[linenum])
1054 def CloseExpression(clean_lines, linenum, pos): argument
1057 If lines[linenum][pos] points to a '(' or '{' or '[', finds the
1058 linenum/pos that correspond to the closing of the expression.
1062 linenum: The number of the line to check.
1066 A tuple (line, linenum, pos) pointer *past* the closing brace, or
1069 'cleansed' line at linenum.
1072 line = clean_lines.elided[linenum]
1083 return (line, linenum, end_pos)
1086 while linenum < clean_lines.NumLines() - 1:
1087 linenum += 1
1088 line = clean_lines.elided[linenum]
1091 return (line, linenum,
1154 for linenum, line in enumerate(lines):
1161 ifndef_linenum = linenum
1167 endif_linenum = linenum
1223 for linenum, line in enumerate(lines):
1225 error(filename, linenum, 'readability/utf8', 5,
1247 def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, error): argument
1261 linenum: The number of the line to check.
1264 line = clean_lines.elided[linenum]
1271 error(filename, linenum, 'readability/multiline_comment', 5,
1279 error(filename, linenum, 'readability/multiline_string', 5,
1302 def CheckPosixThreading(filename, clean_lines, linenum, error): argument
1314 linenum: The number of the line to check.
1317 line = clean_lines.elided[linenum]
1323 error(filename, linenum, 'runtime/threadsafe_fn', 2,
1335 def CheckInvalidIncrement(filename, clean_lines, linenum, error): argument
1348 linenum: The number of the line to check.
1351 line = clean_lines.elided[linenum]
1353 error(filename, linenum, 'runtime/invalid_increment', 5,
1365 def CheckBegin(self, filename, clean_lines, linenum, error): argument
1375 linenum: The number of the line to check.
1380 def CheckEnd(self, filename, clean_lines, linenum, error): argument
1388 linenum: The number of the line to check.
1397 def __init__(self, name, class_or_struct, clean_lines, linenum): argument
1400 self.starting_linenum = linenum
1414 for i in range(linenum, clean_lines.NumLines()):
1421 def CheckBegin(self, filename, clean_lines, linenum, error): argument
1423 if Search('(^|[^:]):($|[^:])', clean_lines.elided[linenum]):
1430 def __init__(self, name, linenum): argument
1433 self.starting_linenum = linenum
1435 def CheckEnd(self, filename, clean_lines, linenum, error): argument
1437 line = clean_lines.raw_lines[linenum]
1450 if (linenum - self.starting_linenum < 10
1471 error(filename, linenum, 'readability/namespace', 5,
1477 error(filename, linenum, 'readability/namespace', 5,
1584 def Update(self, filename, clean_lines, linenum, error): argument
1590 linenum: The number of the line to check.
1593 line = clean_lines.elided[linenum]
1633 new_namespace = _NamespaceInfo(namespace_decl_match.group(1), linenum)
1670 clean_lines, linenum))
1676 self.stack[-1].CheckBegin(filename, clean_lines, linenum, error)
1716 self.stack[-1].CheckEnd(filename, clean_lines, linenum, error)
1750 def CheckForNonStandardConstructs(filename, clean_lines, linenum, argument
1772 linenum: The number of the line to check.
1780 line = clean_lines.lines[linenum]
1783 error(filename, linenum, 'runtime/printf_format', 3,
1787 error(filename, linenum, 'runtime/printf_format', 2,
1794 error(filename, linenum, 'build/printf_format', 3,
1798 line = clean_lines.elided[linenum]
1805 error(filename, linenum, 'build/storage_class', 5,
1809 error(filename, linenum, 'build/endif_comment', 5,
1813 error(filename, linenum, 'build/forward_decl', 5,
1818 error(filename, linenum, 'build/deprecated', 3,
1829 error(filename, linenum, 'runtime/member_string_references', 2,
1853 error(filename, linenum, 'runtime/explicit', 5,
1857 def CheckSpacingForFunctionCall(filename, line, linenum, error): argument
1863 linenum: The number of the line to check.
1901 error(filename, linenum, 'whitespace/parens', 4,
1904 error(filename, linenum, 'whitespace/parens', 2,
1909 error(filename, linenum, 'whitespace/parens', 4,
1917 error(filename, linenum, 'whitespace/parens', 2,
1920 error(filename, linenum, 'whitespace/parens', 2,
1939 def CheckForFunctionLengths(filename, clean_lines, linenum, argument
1958 linenum: The number of the line to check.
1963 line = lines[linenum]
1965 raw_line = raw[linenum]
1981 for start_linenum in xrange(linenum, clean_lines.NumLines()):
2000 error(filename, linenum, 'readability/fn_size', 5,
2003 function_state.Check(error, filename, linenum)
2012 def CheckComment(comment, filename, linenum, error): argument
2018 linenum: The number of the line to check.
2026 error(filename, linenum, 'whitespace/todo', 2,
2031 error(filename, linenum, 'readability/todo', 2,
2038 error(filename, linenum, 'whitespace/todo', 2,
2041 def CheckAccess(filename, clean_lines, linenum, nesting_state, error): argument
2047 linenum: The number of the line to check.
2052 line = clean_lines.elided[linenum] # get rid of comments and strings
2061 error(filename, linenum, 'readability/constructors', 3,
2072 def FindNextMatchingAngleBracket(clean_lines, linenum, init_suffix): argument
2077 linenum: Current line number.
2131 linenum += 1
2132 if linenum >= len(clean_lines.elided):
2134 line = clean_lines.elided[linenum]
2142 def FindPreviousMatchingAngleBracket(clean_lines, linenum, init_prefix): argument
2147 linenum: Current line number.
2190 linenum -= 1
2191 if linenum < 0:
2193 line = clean_lines.elided[linenum]
2199 def CheckSpacing(filename, clean_lines, linenum, nesting_state, error): argument
2211 linenum: The number of the line to check.
2218 line = raw[linenum]
2234 prev_line = elided[linenum - 1]
2252 search_position = linenum-2
2270 error(filename, linenum, 'whitespace/blank_line', 2,
2280 if linenum + 1 < clean_lines.NumLines():
2281 next_line = raw[linenum + 1]
2285 error(filename, linenum, 'whitespace/blank_line', 3,
2290 error(filename, linenum, 'whitespace/blank_line', 3,
2306 error(filename, linenum, 'whitespace/comments', 2,
2322 error(filename, linenum, 'whitespace/comments', 4,
2324 CheckComment(line[commentpos:], filename, linenum, error)
2326 line = clean_lines.elided[linenum] # get rid of comments and strings
2336 error(filename, linenum, 'whitespace/operators', 4,
2349 error(filename, linenum, 'whitespace/operators', 3,
2355 error(filename, linenum, 'whitespace/operators', 3,
2367 not FindNextMatchingAngleBracket(clean_lines, linenum, match.group(1))):
2368 error(filename, linenum, 'whitespace/operators', 3,
2376 not FindPreviousMatchingAngleBracket(clean_lines, linenum,
2378 error(filename, linenum, 'whitespace/operators', 3,
2395 error(filename, linenum, 'whitespace/operators', 3,
2401 error(filename, linenum, 'whitespace/operators', 4,
2407 error(filename, linenum, 'whitespace/parens', 5,
2423 error(filename, linenum, 'whitespace/parens', 5,
2426 error(filename, linenum, 'whitespace/parens', 5,
2432 error(filename, linenum, 'whitespace/comma', 3,
2440 error(filename, linenum, 'whitespace/semicolon', 3,
2444 CheckSpacingForFunctionCall(filename, line, linenum, error)
2451 error(filename, linenum, 'whitespace/braces', 5,
2456 error(filename, linenum, 'whitespace/braces', 5,
2462 error(filename, linenum, 'whitespace/braces', 5,
2469 error(filename, linenum, 'whitespace/semicolon', 5,
2472 error(filename, linenum, 'whitespace/semicolon', 5,
2477 error(filename, linenum, 'whitespace/semicolon', 5,
2485 error(filename, linenum, 'whitespace/forcolon', 2,
2489 def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error): argument
2498 linenum: The number of the line to check.
2513 linenum <= class_info.starting_linenum):
2516 matched = Match(r'\s*(public|protected|private):', clean_lines.lines[linenum])
2526 prev_line = clean_lines.lines[linenum - 1]
2535 for i in range(class_info.starting_linenum, linenum):
2539 if end_class_head < linenum - 1:
2540 error(filename, linenum, 'whitespace/blank_line', 3,
2544 def GetPreviousNonBlankLine(clean_lines, linenum): argument
2549 linenum: The number of the line to check.
2558 prevlinenum = linenum - 1
2567 def CheckBraces(filename, clean_lines, linenum, error): argument
2573 linenum: The number of the line to check.
2577 line = clean_lines.elided[linenum] # get rid of comments and strings
2587 prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0]
2590 error(filename, linenum, 'whitespace/braces', 4,
2595 prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0]
2597 error(filename, linenum, 'whitespace/newline', 4,
2608 (endline, _, endpos) = CloseExpression(clean_lines, linenum, pos)
2610 error(filename, linenum, 'readability/braces', 5,
2613 error(filename, linenum, 'readability/braces', 5,
2618 error(filename, linenum, 'whitespace/newline', 4,
2623 error(filename, linenum, 'whitespace/newline', 4,
2629 prevlinenum = linenum
2639 error(filename, linenum, 'readability/braces', 4,
2643 def CheckEmptyLoopBody(filename, clean_lines, linenum, error): argument
2649 linenum: The number of the line to check.
2656 line = clean_lines.elided[linenum]
2660 clean_lines, linenum, line.find('('))
2705 def CheckCheck(filename, clean_lines, linenum, error): argument
2711 linenum: The number of the line to check.
2719 if raw_lines[linenum].find(macro) >= 0:
2726 line = clean_lines.elided[linenum] # get rid of comments and strings
2731 error(filename, linenum, 'readability/check', 2,
2738 def CheckAltTokens(filename, clean_lines, linenum, error): argument
2744 linenum: The number of the line to check.
2747 line = clean_lines.elided[linenum]
2765 error(filename, linenum, 'readability/alt_tokens', 2,
2792 def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state, argument
2803 linenum: The number of the line to check.
2811 line = raw_lines[linenum]
2814 error(filename, linenum, 'whitespace/tab', 1,
2830 cleansed_line = clean_lines.elided[linenum]
2834 error(filename, linenum, 'whitespace/end_of_line', 4,
2839 error(filename, linenum, 'whitespace/indent', 3,
2845 error(filename, linenum, 'whitespace/labels', 4,
2873 error(filename, linenum, 'whitespace/line_length', 4,
2876 error(filename, linenum, 'whitespace/line_length', 2,
2882 (GetPreviousNonBlankLine(clean_lines, linenum)[0].find('for') == -1 or
2883 GetPreviousNonBlankLine(clean_lines, linenum)[0].find(';') != -1) and
2888 error(filename, linenum, 'whitespace/newline', 0,
2892 CheckBraces(filename, clean_lines, linenum, error)
2893 CheckEmptyLoopBody(filename, clean_lines, linenum, error)
2894 CheckAccess(filename, clean_lines, linenum, nesting_state, error)
2895 CheckSpacing(filename, clean_lines, linenum, nesting_state, error)
2896 CheckCheck(filename, clean_lines, linenum, error)
2897 CheckAltTokens(filename, clean_lines, linenum, error)
2900 CheckSectionSpacing(filename, clean_lines, classinfo, linenum, error)
3018 def CheckIncludeLine(filename, clean_lines, linenum, include_state, error): argument
3028 linenum: The number of the line to check.
3034 line = clean_lines.lines[linenum]
3038 error(filename, linenum, 'build/include', 4,
3049 error(filename, linenum, 'build/include', 4,
3053 include_state[include] = linenum
3069 error(filename, linenum, 'build/include_order', 4,
3073 error(filename, linenum, 'build/include_alpha', 4,
3083 error(filename, linenum, 'readability/streams', 3,
3143 def CheckLanguage(filename, clean_lines, linenum, file_extension, include_state, argument
3153 linenum: The number of the line to check.
3160 line = clean_lines.elided[linenum]
3166 CheckIncludeLine(filename, clean_lines, linenum, include_state, error)
3172 if linenum + 1 < clean_lines.NumLines():
3173 extended_line = line + clean_lines.elided[linenum + 1]
3203 error(filename, linenum, 'runtime/references', 2,
3229 if (linenum == 0 or
3231 clean_lines.elided[linenum - 1])):
3232 error(filename, linenum, 'readability/casting', 4,
3237 CheckCStyleCast(filename, linenum, line, clean_lines.raw_lines[linenum],
3245 if CheckCStyleCast(filename, linenum, line, clean_lines.raw_lines[linenum],
3250 CheckCStyleCast(filename, linenum, line, clean_lines.raw_lines[linenum],
3258 error(filename, linenum, 'runtime/casting', 4,
3274 error(filename, linenum, 'runtime/string', 4,
3281 error(filename, linenum, 'runtime/rtti', 5,
3287 error(filename, linenum, 'runtime/init', 4,
3302 error(filename, linenum, 'runtime/int', 4,
3307 error(filename, linenum, 'runtime/int', 4,
3314 error(filename, linenum, 'runtime/printf', 3,
3320 error(filename, linenum, 'runtime/printf', 5,
3324 error(filename, linenum, 'runtime/printf', 4,
3328 error(filename, linenum, 'runtime/printf', 1,
3338 error(filename, linenum, 'runtime/operator', 4,
3344 error(filename, linenum, 'readability/braces', 4,
3360 error(filename, linenum, 'runtime/printf', 4,
3367 error(filename, linenum, 'runtime/memset', 4,
3372 error(filename, linenum, 'build/namespaces', 5,
3411 error(filename, linenum, 'runtime/arrays', 1,
3423 if match and linenum + 1 < clean_lines.NumLines():
3424 next_line = clean_lines.elided[linenum + 1]
3432 error(filename, linenum, 'readability/constructors', 3,
3441 error(filename, linenum, 'build/namespaces', 4,
3447 def CheckCStyleCast(filename, linenum, line, raw_line, cast_type, pattern, argument
3455 linenum: The number of the line to check.
3474 error(filename, linenum, 'runtime/sizeof', 1,
3503 error(filename, linenum, 'readability/function', 3,
3508 error(filename, linenum, 'readability/casting', 4,
3644 linenum = 0
3646 linenum += 1
3653 include_state.setdefault(include, '%s:%d' % (filename, linenum))
3678 for linenum in xrange(clean_lines.NumLines()):
3679 line = clean_lines.elided[linenum]
3690 required['<string>'] = (linenum, 'string')
3694 required[header] = (linenum, template)
3702 required[header] = (linenum, template)
3753 def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error): argument
3762 linenum: The number of the line to check.
3766 line = raw[linenum]
3769 error(filename, linenum, 'build/explicit_make_pair',
3896 for linenum in range(len(lines)):
3897 if lines[linenum].endswith('\r'):
3898 lines[linenum] = lines[linenum].rstrip('\r')
3918 # Use 0 for linenum since outputting only one error for potentially