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)
| 904 | self.counting = counting_style |
| 905 | |
| 906 | def SetFilters(self, filters): |
| 907 | """Sets the error-message filters. |
| 908 | |
| 909 | These filters are applied when deciding whether to emit a given |
| 910 | error message. |
| 911 | |
| 912 | Args: |
| 913 | filters: A string of comma-separated filters (eg "+whitespace/indent"). |
| 914 | Each filter should start with + or -; else we die. |
| 915 | |
| 916 | Raises: |
| 917 | ValueError: The comma-separated filters did not all start with '+' or '-'. |
| 918 | E.g. "-,+whitespace,-whitespace/indent,whitespace/badfilter" |
| 919 | """ |
| 920 | # Default filters always have less priority than the flag ones. |
| 921 | self.filters = _DEFAULT_FILTERS[:] |
| 922 | self.AddFilters(filters) |
| 923 | |
| 924 | def AddFilters(self, filters): |
| 925 | """ Adds more filters to the existing list of error-message filters. """ |
no test coverage detected