comparison data_schema/__init__.py @ 47:e7f6fc454f84

Disable some false positive pylint warnings
author Franz Glasner <f.glasner@feldmann-mg.com>
date Wed, 02 Aug 2023 17:54:16 +0200
parents 92ae1e882cef
children a0b464f6ab1f
comparison
equal deleted inserted replaced
46:92ae1e882cef 47:e7f6fc454f84
57 INFO = 20 57 INFO = 20
58 WARNING = 30 58 WARNING = 30
59 ERROR = 40 59 ERROR = 40
60 60
61 def __reduce_ex__(self, protocol): 61 def __reduce_ex__(self, protocol):
62 return (getattr, (self.__class__, self._name_)) 62 return (getattr, (self.__class__, self._name_)) # pylint: disable=no-member
63 63
64 64
65 @enum.unique 65 @enum.unique
66 class ERRORS(enum.Enum): 66 class ERRORS(enum.Enum):
67 E10000 = NC_("schema-msg", "dict expected") 67 E10000 = NC_("schema-msg", "dict expected")
124 E10057 = NC_("schema-msg", "`all-of' failed") 124 E10057 = NC_("schema-msg", "`all-of' failed")
125 E10058 = NC_("schema-msg", "failing `all-of' item") 125 E10058 = NC_("schema-msg", "failing `all-of' item")
126 E10059 = NC_("schema-msg", "forbidden key detected") 126 E10059 = NC_("schema-msg", "forbidden key detected")
127 127
128 def __reduce_ex__(self, protocol): 128 def __reduce_ex__(self, protocol):
129 return (getattr, (self.__class__, self._name_)) 129 return (getattr, (self.__class__, self._name_)) # pylint: disable=no-member
130 130
131 131
132 @enum.unique 132 @enum.unique
133 class WARNINGS(enum.Enum): 133 class WARNINGS(enum.Enum):
134 W80000 = NC_("schema-msg", "duplicate dict key") 134 W80000 = NC_("schema-msg", "duplicate dict key")
135 135
136 def __reduce_ex__(self, protocol): 136 def __reduce_ex__(self, protocol):
137 return (getattr, (self.__class__, self._name_)) 137 return (getattr, (self.__class__, self._name_)) # pylint: disable=no-member
138 138
139 139
140 # Check some invariants at import time 140 # Check some invariants at import time
141 for e in ERRORS.__members__: 141 for e in ERRORS.__members__:
142 assert e.startswith('E'), "ERROR code `{}' shall start with letter `E'".format(e) 142 assert e.startswith('E'), "ERROR code `{}' shall start with letter `E'".format(e)