Lines Matching refs:category
102 To suppress false-positive errors of a certain category, add a
103 'NOLINT(category)' comment to the line. NOLINT or NOLINT(*)
119 Specify a comma-separated list of category-filters to apply: only
120 error messages whose category names pass the filters will be printed.
121 (Category names are printed with the message and look like
138 is provided for each category like 'build/class'.
159 # If you add a new error message with a new category, add it to the list
226 # The default state of the category filter. This is overrided by the --filter=
376 category = matched.group(1)
377 if category in (None, '(*)'): # => "suppress all"
380 if category.startswith('(') and category.endswith(')'):
381 category = category[1:-1]
382 if category in _ERROR_CATEGORIES:
383 _error_suppressions.setdefault(category, set()).add(linenum)
386 'Unknown NOLINT error category: %s' % category)
394 def IsErrorSuppressedByNolint(category, linenum):
395 """Returns true if the specified error category is suppressed on this line.
401 category: str, the category of the error.
406 return (linenum in _error_suppressions.get(category, set()) or
611 def IncrementErrorCount(self, category):
616 category = category.split('/')[0]
617 if category not in self.errors_by_category:
618 self.errors_by_category[category] = 0
619 self.errors_by_category[category] += 1
622 """Print a summary of errors by category, and the total."""
623 for category, count in self.errors_by_category.iteritems():
624 sys.stderr.write('Category \'%s\' errors found: %d\n' %
625 (category, count))
832 def _ShouldPrintError(category, confidence, linenum):
833 """If confidence >= verbose, category passes filter and is not suppressed."""
836 # a "NOLINT(category)" comment appears in the source,
838 if IsErrorSuppressedByNolint(category, linenum):
846 if category.startswith(one_filter[1:]):
849 if category.startswith(one_filter[1:]):
859 def Error(filename, linenum, category, confidence, message):
867 "cpplint(category)" comments on the offending line. These are
873 category: A string used to describe the "category" this bug
881 if _ShouldPrintError(category, confidence, linenum):
882 _cpplint_state.IncrementErrorCount(category)
885 filename, linenum, message, category, confidence))
888 filename, linenum, message, category, confidence))
891 filename, linenum, message, category, confidence))