Sets the error-message filters. These filters are applied when deciding whether to emit a given error message. Args: filters: A string of comma-separated filters (eg "+whitespace/indent"). Each filter should start with + or -; else we die.
(self, filters)
| 1435 | self.counting = counting_style |
| 1436 | |
| 1437 | def SetFilters(self, filters): |
| 1438 | """Sets the error-message filters. |
| 1439 | |
| 1440 | These filters are applied when deciding whether to emit a given |
| 1441 | error message. |
| 1442 | |
| 1443 | Args: |
| 1444 | filters: A string of comma-separated filters (eg "+whitespace/indent"). |
| 1445 | Each filter should start with + or -; else we die. |
| 1446 | |
| 1447 | Raises: |
| 1448 | ValueError: The comma-separated filters did not all start with '+' or '-'. |
| 1449 | E.g. "-,+whitespace,-whitespace/indent,whitespace/badfilter" |
| 1450 | """ |
| 1451 | # Default filters always have less priority than the flag ones. |
| 1452 | self.filters = _DEFAULT_FILTERS[:] |
| 1453 | self.AddFilters(filters) |
| 1454 | |
| 1455 | def AddFilters(self, filters): |
| 1456 | """Adds more filters to the existing list of error-message filters.""" |