Skip to content

Commit

Permalink
Fix mypy 'safe-super' error.
Browse files Browse the repository at this point in the history
Mypy now complains about the useless constructor in the
`ControllerDependencyInjector` abstract base class:

  full_offline_backup_for_todoist/runtime.py:15: error: Call to
  abstract method "__init__" of "ControllerDependencyInjector" with
  trivial body via super() is unsafe  [safe-super]

Since the call to the constructor of `ControllerDependencyInjector`
is indeed useless (the constructor is empty), just remove it.
  • Loading branch information
joanbm committed May 12, 2024
1 parent bcef9c6 commit 3e443ce
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 6 deletions.
4 changes: 0 additions & 4 deletions full_offline_backup_for_todoist/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ class TodoistAuth(NamedTuple):
class ControllerDependencyInjector(metaclass=ABCMeta):
""" Rudimentary dependency injection container for the controller """

@abstractmethod
def __init__(self, auth: TodoistAuth, verbose: bool):
""" Initializes the dependencies according to the user configuration """

@property
@abstractmethod
def tracer(self) -> Tracer:
Expand Down
1 change: 0 additions & 1 deletion full_offline_backup_for_todoist/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class RuntimeControllerDependencyInjector(ControllerDependencyInjector):
""" Implementation of the dependency injection container for the actual runtime objects """

def __init__(self, auth: TodoistAuth, verbose: bool):
super().__init__(auth, verbose)
self.__tracer = ConsoleTracer() if verbose else NullTracer()
urldownloader = URLLibURLDownloader(self.__tracer)
todoist_api = TodoistApi(auth.token, self.__tracer, urldownloader)
Expand Down
1 change: 0 additions & 1 deletion tests/test_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class TestControllerDependencyInjector(ControllerDependencyInjector):

def __init__(self, test_tracer, test_todoist_downloader,
test_todoist_attachments_downloader):
super().__init__("", False)
self.__test_tracer = test_tracer
self.__test_todoist_downloader = test_todoist_downloader
self.__test_todoist_attachments_downloader = test_todoist_attachments_downloader
Expand Down

0 comments on commit 3e443ce

Please sign in to comment.