MCPcopy Index your code
hub / github.com/nodejs/node / AddFilters

Method AddFilters

tools/cpplint.py:1495–1509  ·  view source on GitHub ↗

Adds more filters to the existing list of error-message filters.

(self, filters)

Source from the content-addressed store, hash-verified

1493 self.AddFilters(filters)
1494
1495 def AddFilters(self, filters):
1496 """Adds more filters to the existing list of error-message filters."""
1497 for filt in filters.split(","):
1498 clean_filt = filt.strip()
1499 if clean_filt:
1500 if len(clean_filt) > 1 and clean_filt[1:] in _FILTER_SHORTCUTS:
1501 starting_char = clean_filt[0]
1502 new_filters = [starting_char + x for x in _FILTER_SHORTCUTS[clean_filt[1:]]]
1503 self.filters.extend(new_filters)
1504 else:
1505 self.filters.append(clean_filt)
1506 for filt in self.filters:
1507 if not filt.startswith(("+", "-")):
1508 msg = f"Every filter in --filters must start with + or - ({filt} does not)"
1509 raise ValueError(msg)
1510
1511 def BackupFilters(self):
1512 """Saves the current filter list to backup storage."""

Callers 2

SetFiltersMethod · 0.95
_AddFiltersFunction · 0.80

Calls 3

splitMethod · 0.45
extendMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected