-
Notifications
You must be signed in to change notification settings - Fork 0
/
factory.py
24 lines (20 loc) · 1.04 KB
/
factory.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from dataclasses import dataclass
from gitversioniser.config.routines.commit_message import CommitMessageArguments
from gitversioniser.domain.versioniser.routines.commit_message import (
DescribeChangesFactory,
FormatVersionTagFactory,
PlaceVersionTagFactory,
RoutineCommitMessage,
SummarizeChangesFactory,
)
@dataclass
class RoutineCommitMessageFactory:
commit_message_arguments: CommitMessageArguments
def create(self, dependencies) -> RoutineCommitMessage:
return RoutineCommitMessage(
*dependencies,
describe_changes=DescribeChangesFactory.create(self.commit_message_arguments.describe_changes)(*dependencies),
format_version_tag=FormatVersionTagFactory.create(self.commit_message_arguments.format_version_tag)(*dependencies),
place_version_tag=PlaceVersionTagFactory.create(self.commit_message_arguments.place_version_tag)(*dependencies),
summarize_changes=SummarizeChangesFactory.create(self.commit_message_arguments.summarize_changes)(*dependencies),
)