From 8ae262d3afc53a45d10083b666bb9580cb745c29 Mon Sep 17 00:00:00 2001 From: Christoph Witzko <github@christophwitzko.com> Date: Wed, 13 Sep 2023 13:01:03 +0200 Subject: [PATCH] chore: fix linter errors --- .github/workflows/sync-to-gitlab.yml | 2 +- cmd/semantic-release/main.go | 2 +- pkg/analyzer/commit_analyzer_wrapper.go | 8 ++++---- pkg/condition/ci_condition_wrapper.go | 10 +++++----- pkg/generator/changelog_generator_wrapper.go | 8 ++++---- pkg/hooks/hooks_wrapper.go | 10 +++++----- pkg/plugin/grpc.go | 4 ++-- pkg/provider/wrapper.go | 14 +++++++------- pkg/updater/updater_test.go | 2 +- pkg/updater/updater_wrapper.go | 10 +++++----- 10 files changed, 35 insertions(+), 35 deletions(-) diff --git a/.github/workflows/sync-to-gitlab.yml b/.github/workflows/sync-to-gitlab.yml index 91a6971..32169e4 100644 --- a/.github/workflows/sync-to-gitlab.yml +++ b/.github/workflows/sync-to-gitlab.yml @@ -8,7 +8,7 @@ jobs: sync: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Sync to GitLab diff --git a/cmd/semantic-release/main.go b/cmd/semantic-release/main.go index 3ca9e47..b7d15e3 100644 --- a/cmd/semantic-release/main.go +++ b/cmd/semantic-release/main.go @@ -79,7 +79,7 @@ func mergeConfigWithDefaults(defaults, conf map[string]string) { } //gocyclo:ignore -func cliHandler(cmd *cobra.Command, args []string) { +func cliHandler(cmd *cobra.Command, _ []string) { logger.Printf("version: %s\n", SRVERSION) conf, err := config.NewConfig(cmd) diff --git a/pkg/analyzer/commit_analyzer_wrapper.go b/pkg/analyzer/commit_analyzer_wrapper.go index b919b2c..c810392 100644 --- a/pkg/analyzer/commit_analyzer_wrapper.go +++ b/pkg/analyzer/commit_analyzer_wrapper.go @@ -14,7 +14,7 @@ type CommitAnalyzerServer struct { UnimplementedCommitAnalyzerPluginServer } -func (c *CommitAnalyzerServer) Init(ctx context.Context, request *CommitAnalyzerInit_Request) (*CommitAnalyzerInit_Response, error) { +func (c *CommitAnalyzerServer) Init(_ context.Context, request *CommitAnalyzerInit_Request) (*CommitAnalyzerInit_Response, error) { err := c.Impl.Init(request.Config) res := &CommitAnalyzerInit_Response{} if err != nil { @@ -23,15 +23,15 @@ func (c *CommitAnalyzerServer) Init(ctx context.Context, request *CommitAnalyzer return res, nil } -func (c *CommitAnalyzerServer) Name(ctx context.Context, request *CommitAnalyzerName_Request) (*CommitAnalyzerName_Response, error) { +func (c *CommitAnalyzerServer) Name(_ context.Context, _ *CommitAnalyzerName_Request) (*CommitAnalyzerName_Response, error) { return &CommitAnalyzerName_Response{Name: c.Impl.Name()}, nil } -func (c *CommitAnalyzerServer) Version(ctx context.Context, request *CommitAnalyzerVersion_Request) (*CommitAnalyzerVersion_Response, error) { +func (c *CommitAnalyzerServer) Version(_ context.Context, _ *CommitAnalyzerVersion_Request) (*CommitAnalyzerVersion_Response, error) { return &CommitAnalyzerVersion_Response{Version: c.Impl.Version()}, nil } -func (c *CommitAnalyzerServer) Analyze(ctx context.Context, request *AnalyzeCommits_Request) (*AnalyzeCommits_Response, error) { +func (c *CommitAnalyzerServer) Analyze(_ context.Context, request *AnalyzeCommits_Request) (*AnalyzeCommits_Response, error) { return &AnalyzeCommits_Response{ Commits: c.Impl.Analyze(request.RawCommits), }, nil diff --git a/pkg/condition/ci_condition_wrapper.go b/pkg/condition/ci_condition_wrapper.go index b76cfb7..2c6e359 100644 --- a/pkg/condition/ci_condition_wrapper.go +++ b/pkg/condition/ci_condition_wrapper.go @@ -12,15 +12,15 @@ type CIConditionServer struct { UnimplementedCIConditionPluginServer } -func (c *CIConditionServer) Name(ctx context.Context, request *CIName_Request) (*CIName_Response, error) { +func (c *CIConditionServer) Name(_ context.Context, _ *CIName_Request) (*CIName_Response, error) { return &CIName_Response{Name: c.Impl.Name()}, nil } -func (c *CIConditionServer) Version(ctx context.Context, request *CIVersion_Request) (*CIVersion_Response, error) { +func (c *CIConditionServer) Version(_ context.Context, _ *CIVersion_Request) (*CIVersion_Response, error) { return &CIVersion_Response{Version: c.Impl.Version()}, nil } -func (c *CIConditionServer) RunCondition(ctx context.Context, request *RunCondition_Request) (*RunCondition_Response, error) { +func (c *CIConditionServer) RunCondition(_ context.Context, request *RunCondition_Request) (*RunCondition_Response, error) { err := c.Impl.RunCondition(request.Value) ret := &RunCondition_Response{} if err != nil { @@ -29,11 +29,11 @@ func (c *CIConditionServer) RunCondition(ctx context.Context, request *RunCondit return ret, nil } -func (c *CIConditionServer) GetCurrentBranch(ctx context.Context, request *GetCurrentBranch_Request) (*GetCurrentBranch_Response, error) { +func (c *CIConditionServer) GetCurrentBranch(_ context.Context, _ *GetCurrentBranch_Request) (*GetCurrentBranch_Response, error) { return &GetCurrentBranch_Response{Value: c.Impl.GetCurrentBranch()}, nil } -func (c *CIConditionServer) GetCurrentSHA(ctx context.Context, request *GetCurrentSHA_Request) (*GetCurrentSHA_Response, error) { +func (c *CIConditionServer) GetCurrentSHA(_ context.Context, _ *GetCurrentSHA_Request) (*GetCurrentSHA_Response, error) { return &GetCurrentSHA_Response{Value: c.Impl.GetCurrentSHA()}, nil } diff --git a/pkg/generator/changelog_generator_wrapper.go b/pkg/generator/changelog_generator_wrapper.go index 424d5f4..90ae9c3 100644 --- a/pkg/generator/changelog_generator_wrapper.go +++ b/pkg/generator/changelog_generator_wrapper.go @@ -12,7 +12,7 @@ type ChangelogGeneratorServer struct { UnimplementedChangelogGeneratorPluginServer } -func (c *ChangelogGeneratorServer) Init(ctx context.Context, request *ChangelogGeneratorInit_Request) (*ChangelogGeneratorInit_Response, error) { +func (c *ChangelogGeneratorServer) Init(_ context.Context, request *ChangelogGeneratorInit_Request) (*ChangelogGeneratorInit_Response, error) { err := c.Impl.Init(request.Config) res := &ChangelogGeneratorInit_Response{} if err != nil { @@ -21,15 +21,15 @@ func (c *ChangelogGeneratorServer) Init(ctx context.Context, request *ChangelogG return res, nil } -func (c *ChangelogGeneratorServer) Name(ctx context.Context, request *ChangelogGeneratorName_Request) (*ChangelogGeneratorName_Response, error) { +func (c *ChangelogGeneratorServer) Name(_ context.Context, _ *ChangelogGeneratorName_Request) (*ChangelogGeneratorName_Response, error) { return &ChangelogGeneratorName_Response{Name: c.Impl.Name()}, nil } -func (c *ChangelogGeneratorServer) Version(ctx context.Context, request *ChangelogGeneratorVersion_Request) (*ChangelogGeneratorVersion_Response, error) { +func (c *ChangelogGeneratorServer) Version(_ context.Context, _ *ChangelogGeneratorVersion_Request) (*ChangelogGeneratorVersion_Response, error) { return &ChangelogGeneratorVersion_Response{Version: c.Impl.Version()}, nil } -func (c *ChangelogGeneratorServer) Generate(ctx context.Context, request *GenerateChangelog_Request) (*GenerateChangelog_Response, error) { +func (c *ChangelogGeneratorServer) Generate(_ context.Context, request *GenerateChangelog_Request) (*GenerateChangelog_Response, error) { return &GenerateChangelog_Response{ Changelog: c.Impl.Generate(request.Config), }, nil diff --git a/pkg/hooks/hooks_wrapper.go b/pkg/hooks/hooks_wrapper.go index a6f0966..1a8e3a0 100644 --- a/pkg/hooks/hooks_wrapper.go +++ b/pkg/hooks/hooks_wrapper.go @@ -12,7 +12,7 @@ type Server struct { UnimplementedHooksPluginServer } -func (h *Server) Init(ctx context.Context, request *HooksInit_Request) (*HooksInit_Response, error) { +func (h *Server) Init(_ context.Context, request *HooksInit_Request) (*HooksInit_Response, error) { err := h.Impl.Init(request.Config) res := &HooksInit_Response{} if err != nil { @@ -21,15 +21,15 @@ func (h *Server) Init(ctx context.Context, request *HooksInit_Request) (*HooksIn return res, nil } -func (h *Server) Name(ctx context.Context, request *HooksName_Request) (*HooksName_Response, error) { +func (h *Server) Name(_ context.Context, _ *HooksName_Request) (*HooksName_Response, error) { return &HooksName_Response{Name: h.Impl.Name()}, nil } -func (h *Server) Version(ctx context.Context, request *HooksVersion_Request) (*HooksVersion_Response, error) { +func (h *Server) Version(_ context.Context, _ *HooksVersion_Request) (*HooksVersion_Response, error) { return &HooksVersion_Response{Version: h.Impl.Version()}, nil } -func (h *Server) Success(ctx context.Context, request *SuccessHook_Request) (*SuccessHook_Response, error) { +func (h *Server) Success(_ context.Context, request *SuccessHook_Request) (*SuccessHook_Response, error) { err := h.Impl.Success(request.Config) res := &SuccessHook_Response{} if err != nil { @@ -38,7 +38,7 @@ func (h *Server) Success(ctx context.Context, request *SuccessHook_Request) (*Su return res, nil } -func (h *Server) NoRelease(ctx context.Context, request *NoReleaseHook_Request) (*NoReleaseHook_Response, error) { +func (h *Server) NoRelease(_ context.Context, request *NoReleaseHook_Request) (*NoReleaseHook_Response, error) { err := h.Impl.NoRelease(request.Config) res := &NoReleaseHook_Response{} if err != nil { diff --git a/pkg/plugin/grpc.go b/pkg/plugin/grpc.go index 1841570..cafcc14 100644 --- a/pkg/plugin/grpc.go +++ b/pkg/plugin/grpc.go @@ -20,7 +20,7 @@ type GRPCWrapper struct { plugin.NetRPCUnsupportedPlugin } -func (p *GRPCWrapper) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error { +func (p *GRPCWrapper) GRPCServer(_ *plugin.GRPCBroker, s *grpc.Server) error { switch p.Type { case analyzer.CommitAnalyzerPluginName: analyzer.RegisterCommitAnalyzerPluginServer(s, &analyzer.CommitAnalyzerServer{ @@ -52,7 +52,7 @@ func (p *GRPCWrapper) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) erro return nil } -func (p *GRPCWrapper) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error) { +func (p *GRPCWrapper) GRPCClient(_ context.Context, _ *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error) { switch p.Type { case analyzer.CommitAnalyzerPluginName: return &analyzer.CommitAnalyzerClient{ diff --git a/pkg/provider/wrapper.go b/pkg/provider/wrapper.go index 74ffeef..c23783d 100644 --- a/pkg/provider/wrapper.go +++ b/pkg/provider/wrapper.go @@ -14,7 +14,7 @@ type Server struct { UnimplementedProviderPluginServer } -func (s *Server) Init(ctx context.Context, request *ProviderInit_Request) (*ProviderInit_Response, error) { +func (s *Server) Init(_ context.Context, request *ProviderInit_Request) (*ProviderInit_Response, error) { err := s.Impl.Init(request.Config) res := &ProviderInit_Response{} if err != nil { @@ -23,15 +23,15 @@ func (s *Server) Init(ctx context.Context, request *ProviderInit_Request) (*Prov return res, nil } -func (s *Server) Name(ctx context.Context, request *ProviderName_Request) (*ProviderName_Response, error) { +func (s *Server) Name(_ context.Context, _ *ProviderName_Request) (*ProviderName_Response, error) { return &ProviderName_Response{Name: s.Impl.Name()}, nil } -func (s *Server) Version(ctx context.Context, request *ProviderVersion_Request) (*ProviderVersion_Response, error) { +func (s *Server) Version(_ context.Context, _ *ProviderVersion_Request) (*ProviderVersion_Response, error) { return &ProviderVersion_Response{Version: s.Impl.Version()}, nil } -func (s *Server) GetInfo(ctx context.Context, request *GetInfo_Request) (*GetInfo_Response, error) { +func (s *Server) GetInfo(_ context.Context, _ *GetInfo_Request) (*GetInfo_Response, error) { info, err := s.Impl.GetInfo() if err != nil { return &GetInfo_Response{Error: err.Error()}, nil @@ -39,7 +39,7 @@ func (s *Server) GetInfo(ctx context.Context, request *GetInfo_Request) (*GetInf return &GetInfo_Response{Info: info}, nil } -func (s *Server) GetCommits(ctx context.Context, request *GetCommits_Request) (*GetCommits_Response, error) { +func (s *Server) GetCommits(_ context.Context, request *GetCommits_Request) (*GetCommits_Response, error) { commits, err := s.Impl.GetCommits(request.FromSha, request.ToSha) if err != nil { return &GetCommits_Response{Error: err.Error()}, nil @@ -47,7 +47,7 @@ func (s *Server) GetCommits(ctx context.Context, request *GetCommits_Request) (* return &GetCommits_Response{RawCommits: commits}, nil } -func (s *Server) GetReleases(ctx context.Context, request *GetReleases_Request) (*GetReleases_Response, error) { +func (s *Server) GetReleases(_ context.Context, request *GetReleases_Request) (*GetReleases_Response, error) { releases, err := s.Impl.GetReleases(request.Regexp) if err != nil { return &GetReleases_Response{Error: err.Error()}, nil @@ -55,7 +55,7 @@ func (s *Server) GetReleases(ctx context.Context, request *GetReleases_Request) return &GetReleases_Response{Releases: releases}, nil } -func (s *Server) CreateRelease(ctx context.Context, request *CreateRelease_Request) (*CreateRelease_Response, error) { +func (s *Server) CreateRelease(_ context.Context, request *CreateRelease_Request) (*CreateRelease_Response, error) { err := s.Impl.CreateRelease(request.Config) res := &CreateRelease_Response{} if err != nil { diff --git a/pkg/updater/updater_test.go b/pkg/updater/updater_test.go index 0863a78..7017e59 100644 --- a/pkg/updater/updater_test.go +++ b/pkg/updater/updater_test.go @@ -27,7 +27,7 @@ func (tfu *testFileUpdater) ForFiles() string { return "package\\.json" } -func (tfu *testFileUpdater) Apply(file, newVersion string) error { +func (tfu *testFileUpdater) Apply(_, newVersion string) error { tfu.req.Equal(newVersion, tfu.nVer, "invalid version") return nil } diff --git a/pkg/updater/updater_wrapper.go b/pkg/updater/updater_wrapper.go index cf449d1..be353a5 100644 --- a/pkg/updater/updater_wrapper.go +++ b/pkg/updater/updater_wrapper.go @@ -12,7 +12,7 @@ type FilesUpdaterServer struct { UnimplementedFilesUpdaterPluginServer } -func (f *FilesUpdaterServer) Init(ctx context.Context, request *FilesUpdaterInit_Request) (*FilesUpdaterInit_Response, error) { +func (f *FilesUpdaterServer) Init(_ context.Context, request *FilesUpdaterInit_Request) (*FilesUpdaterInit_Response, error) { err := f.Impl.Init(request.Config) res := &FilesUpdaterInit_Response{} if err != nil { @@ -21,19 +21,19 @@ func (f *FilesUpdaterServer) Init(ctx context.Context, request *FilesUpdaterInit return res, nil } -func (f *FilesUpdaterServer) Name(ctx context.Context, request *FilesUpdaterName_Request) (*FilesUpdaterName_Response, error) { +func (f *FilesUpdaterServer) Name(_ context.Context, _ *FilesUpdaterName_Request) (*FilesUpdaterName_Response, error) { return &FilesUpdaterName_Response{Name: f.Impl.Name()}, nil } -func (f *FilesUpdaterServer) Version(ctx context.Context, request *FilesUpdaterVersion_Request) (*FilesUpdaterVersion_Response, error) { +func (f *FilesUpdaterServer) Version(_ context.Context, _ *FilesUpdaterVersion_Request) (*FilesUpdaterVersion_Response, error) { return &FilesUpdaterVersion_Response{Version: f.Impl.Version()}, nil } -func (f *FilesUpdaterServer) ForFiles(ctx context.Context, request *FilesUpdaterForFiles_Request) (*FilesUpdaterForFiles_Response, error) { +func (f *FilesUpdaterServer) ForFiles(_ context.Context, _ *FilesUpdaterForFiles_Request) (*FilesUpdaterForFiles_Response, error) { return &FilesUpdaterForFiles_Response{Files: f.Impl.ForFiles()}, nil } -func (f *FilesUpdaterServer) Apply(ctx context.Context, request *FilesUpdaterApply_Request) (*FilesUpdaterApply_Response, error) { +func (f *FilesUpdaterServer) Apply(_ context.Context, request *FilesUpdaterApply_Request) (*FilesUpdaterApply_Response, error) { err := f.Impl.Apply(request.File, request.NewVersion) res := &FilesUpdaterApply_Response{} if err != nil { -- GitLab