@@ -18,112 +18,18 @@ import (
1818 "github.com/go-semantic-release/semantic-release/v2/pkg/generator"
1919 "github.com/go-semantic-release/semantic-release/v2/pkg/plugin"
2020 "github.com/go-semantic-release/semantic-release/v2/pkg/provider"
21- "github.com/go-semantic-release/semantic-release/v2/pkg/semrel"
2221 "github.com/go-semantic-release/semantic-release/v2/pkg/updater"
2322 "github.com/spf13/cobra"
2423)
2524
26- type tempCommitAnalyzerInterface interface {
27- Analyze (commits []* semrel.RawCommit ) []* semrel.Commit
28- }
29-
30- type tempCommitAnalyzerWrapper struct {
31- tempCommitAnalyzerInterface
32- }
33-
34- func (* tempCommitAnalyzerWrapper ) Init (m map [string ]string ) error {
35- return nil
36- }
37-
38- func (* tempCommitAnalyzerWrapper ) Name () string {
39- return "default"
40- }
41-
42- func (* tempCommitAnalyzerWrapper ) Version () string {
43- return "dev"
44- }
45-
46- type tempCIInterface interface {
47- Name () string
48- RunCondition (m map [string ]string ) error
49- GetCurrentBranch () string
50- GetCurrentSHA () string
51- }
52-
53- type tempCIWrapper struct {
54- tempCIInterface
55- }
56-
57- func (* tempCIWrapper ) Version () string {
58- return "dev"
59- }
60-
61- type tempChangelogGeneratorInterface interface {
62- Generate (config * generator.ChangelogGeneratorConfig ) string
63- }
64-
65- type tempChangelogGeneratorWrapper struct {
66- tempChangelogGeneratorInterface
67- }
68-
69- func (* tempChangelogGeneratorWrapper ) Init (m map [string ]string ) error {
70- return nil
71- }
72-
73- func (* tempChangelogGeneratorWrapper ) Name () string {
74- return "default"
75- }
76-
77- func (* tempChangelogGeneratorWrapper ) Version () string {
78- return "dev"
79- }
80-
81- type tempProviderInterface interface {
82- Init (map [string ]string ) error
83- Name () string
84- GetInfo () (* provider.RepositoryInfo , error )
85- GetCommits (sha string ) ([]* semrel.RawCommit , error )
86- GetReleases (re string ) ([]* semrel.Release , error )
87- CreateRelease (* provider.CreateReleaseConfig ) error
88- }
89-
90- type tempProviderWrapper struct {
91- tempProviderInterface
92- }
93-
94- func (* tempProviderWrapper ) Version () string {
95- return "dev"
96- }
97-
98- type tempFilesUpdaterInterface interface {
99- ForFiles () string
100- Apply (file , newVersion string ) error
101- }
102-
103- type tempFilesUpdaterWrapper struct {
104- tempFilesUpdaterInterface
105- }
106-
107- func (* tempFilesUpdaterWrapper ) Init (m map [string ]string ) error {
108- return nil
109- }
110-
111- func (* tempFilesUpdaterWrapper ) Name () string {
112- return "default"
113- }
114-
115- func (* tempFilesUpdaterWrapper ) Version () string {
116- return "dev"
117- }
118-
11925func RegisterPluginCommands (cmd * cobra.Command ) {
12026 cmd .AddCommand ([]* cobra.Command {
12127 {
12228 Use : analyzer .CommitAnalyzerPluginName ,
12329 Run : func (cmd * cobra.Command , args []string ) {
12430 plugin .Serve (& plugin.ServeOpts {
12531 CommitAnalyzer : func () analyzer.CommitAnalyzer {
126- return & tempCommitAnalyzerWrapper { & defaultAnalyzer.DefaultCommitAnalyzer {} }
32+ return & defaultAnalyzer.DefaultCommitAnalyzer {}
12733 },
12834 })
12935 },
@@ -134,7 +40,7 @@ func RegisterPluginCommands(cmd *cobra.Command) {
13440 Run : func (cmd * cobra.Command , args []string ) {
13541 plugin .Serve (& plugin.ServeOpts {
13642 CICondition : func () condition.CICondition {
137- return & tempCIWrapper { & defaultCI.DefaultCI {} }
43+ return & defaultCI.DefaultCI {}
13844 },
13945 })
14046 },
@@ -145,7 +51,7 @@ func RegisterPluginCommands(cmd *cobra.Command) {
14551 Run : func (cmd * cobra.Command , args []string ) {
14652 plugin .Serve (& plugin.ServeOpts {
14753 CICondition : func () condition.CICondition {
148- return & tempCIWrapper { & githubCI.GitHubActions {} }
54+ return & githubCI.GitHubActions {}
14955 },
15056 })
15157 },
@@ -156,7 +62,7 @@ func RegisterPluginCommands(cmd *cobra.Command) {
15662 Run : func (cmd * cobra.Command , args []string ) {
15763 plugin .Serve (& plugin.ServeOpts {
15864 CICondition : func () condition.CICondition {
159- return & tempCIWrapper { & gitlabCI.GitLab {} }
65+ return & gitlabCI.GitLab {}
16066 },
16167 })
16268 },
@@ -167,7 +73,7 @@ func RegisterPluginCommands(cmd *cobra.Command) {
16773 Run : func (cmd * cobra.Command , args []string ) {
16874 plugin .Serve (& plugin.ServeOpts {
16975 ChangelogGenerator : func () generator.ChangelogGenerator {
170- return & tempChangelogGeneratorWrapper { & defaultGenerator.DefaultChangelogGenerator {} }
76+ return & defaultGenerator.DefaultChangelogGenerator {}
17177 },
17278 })
17379 },
@@ -178,7 +84,7 @@ func RegisterPluginCommands(cmd *cobra.Command) {
17884 Run : func (cmd * cobra.Command , args []string ) {
17985 plugin .Serve (& plugin.ServeOpts {
18086 Provider : func () provider.Provider {
181- return & tempProviderWrapper { & providerGithub.GitHubRepository {} }
87+ return & providerGithub.GitHubRepository {}
18288 },
18389 })
18490 },
@@ -189,7 +95,7 @@ func RegisterPluginCommands(cmd *cobra.Command) {
18995 Run : func (cmd * cobra.Command , args []string ) {
19096 plugin .Serve (& plugin.ServeOpts {
19197 Provider : func () provider.Provider {
192- return & tempProviderWrapper { & providerGitlab.GitLabRepository {} }
98+ return & providerGitlab.GitLabRepository {}
19399 },
194100 })
195101 },
@@ -200,7 +106,7 @@ func RegisterPluginCommands(cmd *cobra.Command) {
200106 Run : func (cmd * cobra.Command , args []string ) {
201107 plugin .Serve (& plugin.ServeOpts {
202108 FilesUpdater : func () updater.FilesUpdater {
203- return & tempFilesUpdaterWrapper { & npmUpdater.Updater {} }
109+ return & npmUpdater.Updater {}
204110 },
205111 })
206112 },
0 commit comments