@@ -134,6 +134,7 @@ class C: pass
134134from mypy .messages import MessageBuilder
135135from mypy .options import Options
136136from mypy .lookup import lookup_fully_qualified
137+ from mypy .errorcodes import ErrorCode
137138import mypy .interpreted_plugin
138139
139140
@@ -152,7 +153,7 @@ class TypeAnalyzerPluginInterface:
152153 options = None # type: Options
153154
154155 @abstractmethod
155- def fail (self , msg : str , ctx : Context ) -> None :
156+ def fail (self , msg : str , ctx : Context , * , code : Optional [ ErrorCode ] = None ) -> None :
156157 """Emmit an error message at given location."""
157158 raise NotImplementedError
158159
@@ -217,7 +218,7 @@ class CheckerPluginInterface:
217218 path = None # type: str
218219
219220 @abstractmethod
220- def fail (self , msg : str , ctx : Context ) -> None :
221+ def fail (self , msg : str , ctx : Context , * , code : Optional [ ErrorCode ] = None ) -> None :
221222 """Emit an error message at given location."""
222223 raise NotImplementedError
223224
@@ -255,7 +256,7 @@ def parse_bool(self, expr: Expression) -> Optional[bool]:
255256
256257 @abstractmethod
257258 def fail (self , msg : str , ctx : Context , serious : bool = False , * ,
258- blocker : bool = False ) -> None :
259+ blocker : bool = False , code : Optional [ ErrorCode ] = None ) -> None :
259260 """Emmit an error message at given location."""
260261 raise NotImplementedError
261262
0 commit comments