Lines Matching refs:linenum

360 def ParseNolintSuppressions(filename, raw_line, linenum, error):  argument
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
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
723 error(filename, linenum, 'readability/fn_size', error_level,
832 def _ShouldPrintError(category, confidence, linenum): argument
838 if IsErrorSuppressedByNolint(category, linenum):
859 def Error(filename, linenum, category, confidence, message): argument
881 if _ShouldPrintError(category, confidence, linenum):
885 filename, linenum, message, category, confidence))
888 filename, linenum, message, category, confidence))
891 filename, linenum, message, category, confidence))
1007 for linenum in range(len(lines)):
1008 self.lines.append(CleanseComments(lines[linenum]))
1009 elided = self._CollapseStrings(lines[linenum])
1061 def CloseExpression(clean_lines, linenum, pos): argument
1079 line = clean_lines.elided[linenum]
1090 return (line, linenum, end_pos)
1093 while linenum < clean_lines.NumLines() - 1:
1094 linenum += 1
1095 line = clean_lines.elided[linenum]
1098 return (line, linenum,
1161 for linenum, line in enumerate(lines):
1168 ifndef_linenum = linenum
1174 endif_linenum = linenum
1230 for linenum, line in enumerate(lines):
1232 error(filename, linenum, 'readability/utf8', 5,
1254 def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, error): argument
1271 line = clean_lines.elided[linenum]
1278 error(filename, linenum, 'readability/multiline_comment', 5,
1286 error(filename, linenum, 'readability/multiline_string', 5,
1309 def CheckPosixThreading(filename, clean_lines, linenum, error): argument
1324 line = clean_lines.elided[linenum]
1330 error(filename, linenum, 'runtime/threadsafe_fn', 2,
1342 def CheckInvalidIncrement(filename, clean_lines, linenum, error): argument
1358 line = clean_lines.elided[linenum]
1360 error(filename, linenum, 'runtime/invalid_increment', 5,
1372 def CheckBegin(self, filename, clean_lines, linenum, error): argument
1387 def CheckEnd(self, filename, clean_lines, linenum, error): argument
1404 def __init__(self, name, class_or_struct, clean_lines, linenum): argument
1407 self.starting_linenum = linenum
1421 for i in range(linenum, clean_lines.NumLines()):
1428 def CheckBegin(self, filename, clean_lines, linenum, error): argument
1430 if Search('(^|[^:]):($|[^:])', clean_lines.elided[linenum]):
1437 def __init__(self, name, linenum): argument
1440 self.starting_linenum = linenum
1442 def CheckEnd(self, filename, clean_lines, linenum, error): argument
1444 line = clean_lines.raw_lines[linenum]
1457 if (linenum - self.starting_linenum < 10
1478 error(filename, linenum, 'readability/namespace', 5,
1484 error(filename, linenum, 'readability/namespace', 5,
1591 def Update(self, filename, clean_lines, linenum, error): argument
1600 line = clean_lines.elided[linenum]
1640 new_namespace = _NamespaceInfo(namespace_decl_match.group(1), linenum)
1677 clean_lines, linenum))
1683 self.stack[-1].CheckBegin(filename, clean_lines, linenum, error)
1723 self.stack[-1].CheckEnd(filename, clean_lines, linenum, error)
1757 def CheckForNonStandardConstructs(filename, clean_lines, linenum, argument
1787 line = clean_lines.lines[linenum]
1790 error(filename, linenum, 'runtime/printf_format', 3,
1794 error(filename, linenum, 'runtime/printf_format', 2,
1801 error(filename, linenum, 'build/printf_format', 3,
1805 line = clean_lines.elided[linenum]
1812 error(filename, linenum, 'build/storage_class', 5,
1816 error(filename, linenum, 'build/endif_comment', 5,
1820 error(filename, linenum, 'build/forward_decl', 5,
1825 error(filename, linenum, 'build/deprecated', 3,
1836 error(filename, linenum, 'runtime/member_string_references', 2,
1860 error(filename, linenum, 'runtime/explicit', 5,
1864 def CheckSpacingForFunctionCall(filename, line, linenum, error): argument
1911 error(filename, linenum, 'whitespace/parens', 4,
1914 error(filename, linenum, 'whitespace/parens', 2,
1919 error(filename, linenum, 'whitespace/parens', 4,
1927 error(filename, linenum, 'whitespace/parens', 2,
1930 error(filename, linenum, 'whitespace/parens', 2,
1949 def CheckForFunctionLengths(filename, clean_lines, linenum, argument
1973 line = lines[linenum]
1975 raw_line = raw[linenum]
1991 for start_linenum in xrange(linenum, clean_lines.NumLines()):
2010 error(filename, linenum, 'readability/fn_size', 5,
2013 function_state.Check(error, filename, linenum)
2022 def CheckComment(comment, filename, linenum, error): argument
2036 error(filename, linenum, 'whitespace/todo', 2,
2041 error(filename, linenum, 'readability/todo', 2,
2048 error(filename, linenum, 'whitespace/todo', 2,
2051 def CheckAccess(filename, clean_lines, linenum, nesting_state, error): argument
2062 line = clean_lines.elided[linenum] # get rid of comments and strings
2071 error(filename, linenum, 'readability/constructors', 3,
2082 def FindNextMatchingAngleBracket(clean_lines, linenum, init_suffix): argument
2141 linenum += 1
2142 if linenum >= len(clean_lines.elided):
2144 line = clean_lines.elided[linenum]
2152 def FindPreviousMatchingAngleBracket(clean_lines, linenum, init_prefix): argument
2200 linenum -= 1
2201 if linenum < 0:
2203 line = clean_lines.elided[linenum]
2209 def CheckSpacing(filename, clean_lines, linenum, nesting_state, error): argument
2228 line = raw[linenum]
2244 prev_line = elided[linenum - 1]
2262 search_position = linenum-2
2280 error(filename, linenum, 'whitespace/blank_line', 2,
2290 if linenum + 1 < clean_lines.NumLines():
2291 next_line = raw[linenum + 1]
2295 error(filename, linenum, 'whitespace/blank_line', 3,
2300 error(filename, linenum, 'whitespace/blank_line', 3,
2316 error(filename, linenum, 'whitespace/comments', 2,
2332 error(filename, linenum, 'whitespace/comments', 4,
2334 CheckComment(line[commentpos:], filename, linenum, error)
2336 line = clean_lines.elided[linenum] # get rid of comments and strings
2346 error(filename, linenum, 'whitespace/operators', 4,
2359 error(filename, linenum, 'whitespace/operators', 3,
2365 error(filename, linenum, 'whitespace/operators', 3,
2377 not FindNextMatchingAngleBracket(clean_lines, linenum, match.group(1))):
2378 error(filename, linenum, 'whitespace/operators', 3,
2386 not FindPreviousMatchingAngleBracket(clean_lines, linenum,
2388 error(filename, linenum, 'whitespace/operators', 3,
2405 error(filename, linenum, 'whitespace/operators', 3,
2411 error(filename, linenum, 'whitespace/operators', 4,
2417 error(filename, linenum, 'whitespace/parens', 5,
2433 error(filename, linenum, 'whitespace/parens', 5,
2436 error(filename, linenum, 'whitespace/parens', 5,
2442 error(filename, linenum, 'whitespace/comma', 3,
2450 error(filename, linenum, 'whitespace/semicolon', 3,
2454 CheckSpacingForFunctionCall(filename, line, linenum, error)
2461 error(filename, linenum, 'whitespace/braces', 5,
2466 error(filename, linenum, 'whitespace/braces', 5,
2472 error(filename, linenum, 'whitespace/braces', 5,
2479 error(filename, linenum, 'whitespace/semicolon', 5,
2482 error(filename, linenum, 'whitespace/semicolon', 5,
2487 error(filename, linenum, 'whitespace/semicolon', 5,
2495 error(filename, linenum, 'whitespace/forcolon', 2,
2499 def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error): argument
2523 linenum <= class_info.starting_linenum):
2526 matched = Match(r'\s*(public|protected|private):', clean_lines.lines[linenum])
2536 prev_line = clean_lines.lines[linenum - 1]
2545 for i in range(class_info.starting_linenum, linenum):
2549 if end_class_head < linenum - 1:
2550 error(filename, linenum, 'whitespace/blank_line', 3,
2554 def GetPreviousNonBlankLine(clean_lines, linenum): argument
2568 prevlinenum = linenum - 1
2577 def CheckBraces(filename, clean_lines, linenum, error): argument
2587 line = clean_lines.elided[linenum] # get rid of comments and strings
2597 prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0]
2600 error(filename, linenum, 'whitespace/braces', 4,
2605 prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0]
2607 error(filename, linenum, 'whitespace/newline', 4,
2618 (endline, _, endpos) = CloseExpression(clean_lines, linenum, pos)
2620 error(filename, linenum, 'readability/braces', 5,
2623 error(filename, linenum, 'readability/braces', 5,
2628 error(filename, linenum, 'whitespace/newline', 4,
2633 error(filename, linenum, 'whitespace/newline', 4,
2639 prevlinenum = linenum
2649 error(filename, linenum, 'readability/braces', 4,
2653 def CheckEmptyLoopBody(filename, clean_lines, linenum, error): argument
2666 line = clean_lines.elided[linenum]
2670 clean_lines, linenum, line.find('('))
2715 def CheckCheck(filename, clean_lines, linenum, error): argument
2729 if raw_lines[linenum].find(macro) >= 0:
2736 line = clean_lines.elided[linenum] # get rid of comments and strings
2741 error(filename, linenum, 'readability/check', 2,
2748 def CheckAltTokens(filename, clean_lines, linenum, error): argument
2757 line = clean_lines.elided[linenum]
2775 error(filename, linenum, 'readability/alt_tokens', 2,
2802 def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state, argument
2821 line = raw_lines[linenum]
2824 error(filename, linenum, 'whitespace/tab', 1,
2840 cleansed_line = clean_lines.elided[linenum]
2844 error(filename, linenum, 'whitespace/end_of_line', 4,
2849 error(filename, linenum, 'whitespace/indent', 3,
2855 error(filename, linenum, 'whitespace/labels', 4,
2883 error(filename, linenum, 'whitespace/line_length', 4,
2886 error(filename, linenum, 'whitespace/line_length', 2,
2892 (GetPreviousNonBlankLine(clean_lines, linenum)[0].find('for') == -1 or
2893 GetPreviousNonBlankLine(clean_lines, linenum)[0].find(';') != -1) and
2898 error(filename, linenum, 'whitespace/newline', 0,
2902 CheckBraces(filename, clean_lines, linenum, error)
2903 CheckEmptyLoopBody(filename, clean_lines, linenum, error)
2904 CheckAccess(filename, clean_lines, linenum, nesting_state, error)
2905 CheckSpacing(filename, clean_lines, linenum, nesting_state, error)
2906 CheckCheck(filename, clean_lines, linenum, error)
2907 CheckAltTokens(filename, clean_lines, linenum, error)
2910 CheckSectionSpacing(filename, clean_lines, classinfo, linenum, error)
3028 def CheckIncludeLine(filename, clean_lines, linenum, include_state, error): argument
3044 line = clean_lines.lines[linenum]
3048 error(filename, linenum, 'build/include', 4,
3059 error(filename, linenum, 'build/include', 4,
3063 include_state[include] = linenum
3079 error(filename, linenum, 'build/include_order', 4,
3083 error(filename, linenum, 'build/include_alpha', 4,
3093 error(filename, linenum, 'readability/streams', 3,
3153 def CheckLanguage(filename, clean_lines, linenum, file_extension, include_state, argument
3170 line = clean_lines.elided[linenum]
3176 CheckIncludeLine(filename, clean_lines, linenum, include_state, error)
3182 if linenum + 1 < clean_lines.NumLines():
3183 extended_line = line + clean_lines.elided[linenum + 1]
3213 error(filename, linenum, 'runtime/references', 2,
3239 if (linenum == 0 or
3241 clean_lines.elided[linenum - 1])):
3242 error(filename, linenum, 'readability/casting', 4,
3247 CheckCStyleCast(filename, linenum, line, clean_lines.raw_lines[linenum],
3255 if CheckCStyleCast(filename, linenum, line, clean_lines.raw_lines[linenum],
3260 CheckCStyleCast(filename, linenum, line, clean_lines.raw_lines[linenum],
3268 error(filename, linenum, 'runtime/casting', 4,
3284 error(filename, linenum, 'runtime/string', 4,
3291 error(filename, linenum, 'runtime/rtti', 5,
3297 error(filename, linenum, 'runtime/init', 4,
3312 error(filename, linenum, 'runtime/int', 4,
3317 error(filename, linenum, 'runtime/int', 4,
3324 error(filename, linenum, 'runtime/printf', 3,
3330 error(filename, linenum, 'runtime/printf', 5,
3334 error(filename, linenum, 'runtime/printf', 4,
3338 error(filename, linenum, 'runtime/printf', 1,
3348 error(filename, linenum, 'runtime/operator', 4,
3354 error(filename, linenum, 'readability/braces', 4,
3370 error(filename, linenum, 'runtime/printf', 4,
3377 error(filename, linenum, 'runtime/memset', 4,
3382 error(filename, linenum, 'build/namespaces', 5,
3421 error(filename, linenum, 'runtime/arrays', 1,
3433 if match and linenum + 1 < clean_lines.NumLines():
3434 next_line = clean_lines.elided[linenum + 1]
3442 error(filename, linenum, 'readability/constructors', 3,
3451 error(filename, linenum, 'build/namespaces', 4,
3457 def CheckCStyleCast(filename, linenum, line, raw_line, cast_type, pattern, argument
3484 error(filename, linenum, 'runtime/sizeof', 1,
3513 error(filename, linenum, 'readability/function', 3,
3518 error(filename, linenum, 'readability/casting', 4,
3654 linenum = 0
3656 linenum += 1
3663 include_state.setdefault(include, '%s:%d' % (filename, linenum))
3688 for linenum in xrange(clean_lines.NumLines()):
3689 line = clean_lines.elided[linenum]
3700 required['<string>'] = (linenum, 'string')
3704 required[header] = (linenum, template)
3712 required[header] = (linenum, template)
3763 def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error): argument
3776 line = raw[linenum]
3779 error(filename, linenum, 'build/explicit_make_pair',
3906 for linenum in range(len(lines)):
3907 if lines[linenum].endswith('\r'):
3908 lines[linenum] = lines[linenum].rstrip('\r')