mirror of
https://github.com/ditkrg/todo-to-issue-action.git
synced 2026-01-25 07:16:42 +00:00
refactor: add common base class to GitHubClient and LocalClient
Enables adding type checking to minimize mypy errors
This commit is contained in:
4
main.py
4
main.py
@@ -10,18 +10,20 @@ import operator
|
||||
from collections import defaultdict
|
||||
from TodoParser import TodoParser
|
||||
from LineStatus import LineStatus
|
||||
from Client import Client
|
||||
from LocalClient import LocalClient
|
||||
from GitHubClient import GitHubClient
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
client: Client | None = None
|
||||
# Try to create a basic client for communicating with the remote version control server, automatically initialised with environment variables.
|
||||
try:
|
||||
# try to build a GitHub client
|
||||
client = GitHubClient()
|
||||
except EnvironmentError:
|
||||
# don't immediately give up
|
||||
client = None
|
||||
pass
|
||||
# if needed, fall back to using a local client for testing
|
||||
client = client or LocalClient()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user