53 @param repeat flag indicating to report each occurrence of a code |
53 @param repeat flag indicating to report each occurrence of a code |
54 @type bool |
54 @type bool |
55 @param args dictionary of arguments for the various checks |
55 @param args dictionary of arguments for the various checks |
56 @type dict |
56 @type dict |
57 """ |
57 """ |
58 self.__select = tuple(select) # noqa: M188 |
58 self.__select = tuple(select) |
59 self.__ignore = ("",) if select else tuple(ignore) # noqa: M188 |
59 self.__ignore = tuple(ignore) |
60 self.__expected = expected[:] |
60 self.__expected = expected[:] |
61 self.__repeat = repeat |
61 self.__repeat = repeat |
62 self.__filename = filename |
62 self.__filename = filename |
63 self.__source = source[:] |
63 self.__source = source[:] |
64 self.__tree = copy.deepcopy(tree) |
64 self.__tree = copy.deepcopy(tree) |
105 @param code message code to check for |
105 @param code message code to check for |
106 @type str |
106 @type str |
107 @return flag indicating to ignore the given code |
107 @return flag indicating to ignore the given code |
108 @rtype bool |
108 @rtype bool |
109 """ |
109 """ |
110 return code.startswith(self.__ignore) and not code.startswith(self.__select) |
110 return ( |
|
111 code in self.__ignore |
|
112 or (code.startswith(self.__ignore) and not code.startswith(self.__select)) |
|
113 ) |
111 |
114 |
112 def __error(self, lineNumber, offset, code, *args): |
115 def __error(self, lineNumber, offset, code, *args): |
113 """ |
116 """ |
114 Private method to record an issue. |
117 Private method to record an issue. |
115 |
118 |