Lines Matching refs:Category
103 To suppress false-positive errors of a certain category, add a
104 'NOLINT(category)' comment to the line. NOLINT or NOLINT(*)
123 Specify a comma-separated list of category-filters to apply: only
124 error messages whose category names pass the filters will be printed.
125 (Category names are printed with the message and look like
142 is provided for each category like 'build/class'.
163 # If you add a new error message with a new category, add it to the list
230 # The default state of the category filter. This is overrided by the --filter=
380 category = matched.group(1)
381 if category in (None, '(*)'): # => "suppress all"
384 if category.startswith('(') and category.endswith(')'):
385 category = category[1:-1]
386 if category in _ERROR_CATEGORIES:
387 _error_suppressions.setdefault(category, set()).add(linenum)
390 'Unknown NOLINT error category: %s' % category)
398 def IsErrorSuppressedByNolint(category, linenum):
399 """Returns true if the specified error category is suppressed on this line.
405 category: str, the category of the error.
410 return (linenum in _error_suppressions.get(category, set()) or
626 def IncrementErrorCount(self, category):
631 category = category.split('/')[0]
632 if category not in self.errors_by_category:
633 self.errors_by_category[category] = 0
634 self.errors_by_category[category] += 1
637 """Print a summary of errors by category, and the total."""
638 for category, count in self.errors_by_category.iteritems():
639 sys.stderr.write('Category \'%s\' errors found: %d\n' %
640 (category, count))
858 def _ShouldPrintError(category, confidence, linenum):
859 """If confidence >= verbose, category passes filter and is not suppressed."""
862 # a "NOLINT(category)" comment appears in the source,
864 if IsErrorSuppressedByNolint(category, linenum):
872 if category.startswith(one_filter[1:]):
875 if category.startswith(one_filter[1:]):
885 def Error(filename, linenum, category, confidence, message):
893 "cpplint(category)" comments on the offending line. These are
899 category: A string used to describe the "category" this bug
907 if _ShouldPrintError(category, confidence, linenum):
908 _cpplint_state.IncrementErrorCount(category)
911 filename, linenum, message, category, confidence))
914 filename, linenum, message, category, confidence))
917 filename, linenum, message, category, confidence))