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)
| 787 | self.counting = counting_style |
| 788 | |
| 789 | def SetFilters(self, filters): |
| 790 | """Sets the error-message filters. |
| 791 | |
| 792 | These filters are applied when deciding whether to emit a given |
| 793 | error message. |
| 794 | |
| 795 | Args: |
| 796 | filters: A string of comma-separated filters (eg "+whitespace/indent"). |
| 797 | Each filter should start with + or -; else we die. |
| 798 | |
| 799 | Raises: |
| 800 | ValueError: The comma-separated filters did not all start with '+' or '-'. |
| 801 | E.g. "-,+whitespace,-whitespace/indent,whitespace/badfilter" |
| 802 | """ |
| 803 | # Default filters always have less priority than the flag ones. |
| 804 | self.filters = _DEFAULT_FILTERS[:] |
| 805 | self.AddFilters(filters) |
| 806 | |
| 807 | def AddFilters(self, filters): |
| 808 | """ Adds more filters to the existing list of error-message filters. """ |
no test coverage detected