From a8e04c61c8670fe3c16472c9550e4b03968a5114 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Thu, 17 Dec 2020 12:05:37 +0100 Subject: golangci: Do not use default excludes The golangci-lint project has a set of default excludes for linters which are applied by default. This means that we cannot choose ourselves which linting messages we want to include, as some of them cannot be controlled by us. One noteworthy linting check which is excluded right now checks whether comments for types and functions are prefixed with their respective name. This is something which we try to enforce in Gitaly, too, but naturally there's cases where it slips through review. So let's disable the default excludes such that we can enable this linting check. As it turns out, there's quite a lot of cases where we failed to adhere to this style, which this commit also fixes. One thing which we don't do though is to have per-package comments, so let's actively ignore it for now. --- internal/git2go/conflicts.go | 2 +- internal/git2go/merge.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/git2go') diff --git a/internal/git2go/conflicts.go b/internal/git2go/conflicts.go index 67f91808a..9bca079ed 100644 --- a/internal/git2go/conflicts.go +++ b/internal/git2go/conflicts.go @@ -70,7 +70,7 @@ func ConflictsCommandFromSerialized(serialized string) (ConflictsCommand, error) return request, nil } -// Serialize serializes the conflicts result. +// SerializeTo serializes the conflicts result and writes it into the writer. func (m ConflictsResult) SerializeTo(writer io.Writer) error { return serializeTo(writer, m) } diff --git a/internal/git2go/merge.go b/internal/git2go/merge.go index 39b2efe15..7659930a1 100644 --- a/internal/git2go/merge.go +++ b/internal/git2go/merge.go @@ -64,7 +64,7 @@ func (m MergeResult) SerializeTo(w io.Writer) error { return serializeTo(w, m) } -// Merge performs a merge via gitaly-git2go. +// Run performs a merge via gitaly-git2go. func (m MergeCommand) Run(ctx context.Context, cfg config.Cfg) (MergeResult, error) { if err := m.verify(); err != nil { return MergeResult{}, fmt.Errorf("merge: %w: %s", ErrInvalidArgument, err.Error()) -- cgit v1.2.3