Skip to content

Commit 1d1e036

Browse files
feat: convert config struct to proto message
1 parent dddfd54 commit 1d1e036

18 files changed

+588
-56
lines changed

cmd/semantic-release/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,14 @@ func cliHandler(cmd *cobra.Command, _ []string) {
183183

184184
exitIfError(hooksExecutor.Init(hooksConfig))
185185

186-
if !conf.NoCI {
186+
if !conf.NoCi {
187187
logger.Println("running CI condition...")
188188
conditionConfig := map[string]string{
189189
"token": conf.Token,
190190
"defaultBranch": repoInfo.DefaultBranch,
191191
"private": fmt.Sprintf("%t", repoInfo.Private),
192192
}
193-
mergeConfigWithDefaults(conditionConfig, conf.CIConditionOpts)
193+
mergeConfigWithDefaults(conditionConfig, conf.CiConditionOpts)
194194

195195
err = ci.RunCondition(conditionConfig)
196196
if err != nil {

pkg/analyzer/commit_analyzer.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/analyzer/commit_analyzer_grpc.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/condition/ci_condition.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/condition/ci_condition_grpc.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/config/config.go

+3-39
Original file line numberDiff line numberDiff line change
@@ -9,42 +9,6 @@ import (
99
"github.com/spf13/viper"
1010
)
1111

12-
// Config is a complete set of app configuration
13-
type Config struct {
14-
Token string
15-
ProviderPlugin string
16-
ProviderOpts map[string]string
17-
CommitAnalyzerPlugin string
18-
CommitAnalyzerOpts map[string]string
19-
CIConditionPlugin string
20-
CIConditionOpts map[string]string
21-
ChangelogGeneratorPlugin string
22-
ChangelogGeneratorOpts map[string]string
23-
Changelog string
24-
FilesUpdaterPlugins []string
25-
FilesUpdaterOpts map[string]string
26-
HooksPlugins []string
27-
HooksOpts map[string]string
28-
UpdateFiles []string
29-
Match string
30-
VersionFile bool
31-
Prerelease bool
32-
Ghr bool
33-
NoCI bool
34-
Dry bool
35-
AllowInitialDevelopmentVersions bool
36-
AllowNoChanges bool
37-
ForceBumpPatchVersion bool
38-
MaintainedVersion string
39-
PrependChangelog bool
40-
DownloadPlugins bool
41-
ShowProgress bool
42-
AllowMaintainedVersionOnDefaultBranch bool
43-
PluginResolver string
44-
PluginResolverEndpoint string
45-
PluginResolverDisableBatchPrefetch bool
46-
}
47-
4812
func mustGetString(cmd *cobra.Command, name string) string {
4913
res, err := cmd.Flags().GetString(name)
5014
if err != nil {
@@ -110,8 +74,8 @@ func NewConfig(cmd *cobra.Command) (*Config, error) {
11074
ProviderOpts: provOpts,
11175
CommitAnalyzerPlugin: viper.GetString("plugins.commit-analyzer.name"),
11276
CommitAnalyzerOpts: caOpts,
113-
CIConditionPlugin: viper.GetString("plugins.ci-condition.name"),
114-
CIConditionOpts: ciOpts,
77+
CiConditionPlugin: viper.GetString("plugins.ci-condition.name"),
78+
CiConditionOpts: ciOpts,
11579
ChangelogGeneratorPlugin: viper.GetString("plugins.changelog-generator.name"),
11680
ChangelogGeneratorOpts: cgOpts,
11781
Changelog: mustGetString(cmd, "changelog"),
@@ -124,7 +88,7 @@ func NewConfig(cmd *cobra.Command) (*Config, error) {
12488
VersionFile: mustGetBool(cmd, "version-file"),
12589
Prerelease: mustGetBool(cmd, "prerelease"),
12690
Ghr: mustGetBool(cmd, "ghr"),
127-
NoCI: mustGetBool(cmd, "no-ci"),
91+
NoCi: mustGetBool(cmd, "no-ci"),
12892
Dry: mustGetBool(cmd, "dry"),
12993
AllowInitialDevelopmentVersions: mustGetBool(cmd, "allow-initial-development-versions"),
13094
AllowNoChanges: mustGetBool(cmd, "allow-no-changes"),

0 commit comments

Comments
 (0)