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. Raises: ValueE
(self, filters)
| 1291 | self.counting = counting_style |
| 1292 | |
| 1293 | def SetFilters(self, filters): |
| 1294 | """Sets the error-message filters. |
| 1295 | |
| 1296 | These filters are applied when deciding whether to emit a given |
| 1297 | error message. |
| 1298 | |
| 1299 | Args: |
| 1300 | filters: A string of comma-separated filters (eg "+whitespace/indent"). |
| 1301 | Each filter should start with + or -; else we die. |
| 1302 | |
| 1303 | Raises: |
| 1304 | ValueError: The comma-separated filters did not all start with '+' or '-'. |
| 1305 | E.g. "-,+whitespace,-whitespace/indent,whitespace/badfilter" |
| 1306 | """ |
| 1307 | # Default filters always have less priority than the flag ones. |
| 1308 | self.filters = _DEFAULT_FILTERS[:] |
| 1309 | self.AddFilters(filters) |
| 1310 | |
| 1311 | def AddFilters(self, filters): |
| 1312 | """ Adds more filters to the existing list of error-message filters. """ |
no test coverage detected