Skip to content

Commit

Permalink
add missing type annotations (RasaHQ#10091)
Browse files Browse the repository at this point in the history
  • Loading branch information
wochinge authored Nov 5, 2021
1 parent 0983b33 commit 456f34a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ disallow_untyped_decorators = True
# see https://github.com/RasaHQ/rasa/pull/6470
# the list below is sorted by the number of errors for each error code, in decreasing order
disable_error_code = arg-type, assignment, var-annotated, union-attr,
override, attr-defined, misc, no-untyped-call
override, attr-defined, misc
3 changes: 1 addition & 2 deletions stubs/sanic/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from sanic.__version__ import __version__
from sanic.app import Sanic
from sanic.blueprints import Blueprint

__all__ = ["Sanic", "Blueprint", "__version__"]
__all__ = ["Sanic", "__version__"]
7 changes: 7 additions & 0 deletions stubs/sanic/app.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from sanic.app import Sanic as SanicSanic


class Sanic(SanicSanic):

def stop(self) -> None:
...
Empty file added stubs/sanic/mixins/__init__.pyi
Empty file.
8 changes: 8 additions & 0 deletions stubs/sanic/mixins/exceptions.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from sanic.mixins.routes import RouteWrapper
from typing_extensions import Protocol


class ExceptionMixin(Protocol):

def exception(self, *exceptions: Exception, apply: bool =True) -> RouteWrapper:
...

0 comments on commit 456f34a

Please sign in to comment.