Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkarthik nayak <knayak@gitlab.com>2022-10-10 17:33:47 +0300
committerkarthik nayak <knayak@gitlab.com>2022-10-10 17:33:47 +0300
commita3a94460be05799fdb5f9b4d1dab7832fe556bcd (patch)
treeb397054876fffc6d532a44f4e80509f264a28beb
parentcc9fe2bf1bce969be9d9616a67c386f0a7fc9b25 (diff)
parent58fe50f7aeedd388d8990f2835cf42f485bebf21 (diff)
Merge branch 'lint-fixes' into 'master'
Makefile: Add `lint-fix` command See merge request https://gitlab.com/gitlab-org/gitaly/-/merge_requests/4900 Merged-by: karthik nayak <knayak@gitlab.com> Approved-by: John Cai <jcai@gitlab.com>
-rw-r--r--Makefile5
-rw-r--r--auth/token.go2
-rw-r--r--internal/middleware/featureflag/featureflag_handler_test.go4
-rw-r--r--internal/praefect/service/checks.go2
4 files changed, 9 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 600e3193f..8f75db62f 100644
--- a/Makefile
+++ b/Makefile
@@ -442,6 +442,11 @@ check-mod-tidy:
lint: ${GOLANGCI_LINT} libgit2 ${GITALY_PACKED_EXECUTABLES}
${Q}${GOLANGCI_LINT} run --build-tags "${SERVER_BUILD_TAGS},${GIT2GO_BUILD_TAGS}" --out-format tab --config ${GOLANGCI_LINT_CONFIG} ${GOLANGCI_LINT_OPTIONS}
+.PHONY: lint-fix
+## Run Go linter and write back fixes to the files (not supported by all linters).
+lint-fix: ${GOLANGCI_LINT} libgit2 ${GITALY_PACKED_EXECUTABLES}
+ ${Q}${GOLANGCI_LINT} run --fix --build-tags "${SERVER_BUILD_TAGS},${GIT2GO_BUILD_TAGS}" --out-format tab --config ${GOLANGCI_LINT_CONFIG} ${GOLANGCI_LINT_OPTIONS}
+
.PHONY: format
## Run Go formatter and adjust imports.
format: ${GOIMPORTS} ${GOFUMPT}
diff --git a/auth/token.go b/auth/token.go
index d38f3ccee..7a32b8c78 100644
--- a/auth/token.go
+++ b/auth/token.go
@@ -18,7 +18,7 @@ import (
)
var (
- //nolint: gochecknoglobals
+ //nolint:gochecknoglobals
// This infrastructure is required for testing purposes and there is no
// proper place to put it instead. While we could move it into the
// config, we certainly don't want to make it configurable for now, so
diff --git a/internal/middleware/featureflag/featureflag_handler_test.go b/internal/middleware/featureflag/featureflag_handler_test.go
index 8d1a4ec8f..649506cc8 100644
--- a/internal/middleware/featureflag/featureflag_handler_test.go
+++ b/internal/middleware/featureflag/featureflag_handler_test.go
@@ -47,7 +47,7 @@ func TestStreamInterceptor(t *testing.T) {
}
func callUnary(ctx context.Context) {
- //nolint: errcheck
+ //nolint:errcheck
UnaryInterceptor(ctx, nil, nil, func(context.Context, interface{}) (interface{}, error) {
ctxlogrus.Extract(ctx).Info("verify")
return nil, nil
@@ -55,7 +55,7 @@ func callUnary(ctx context.Context) {
}
func callStream(ctx context.Context) {
- //nolint: errcheck
+ //nolint:errcheck
StreamInterceptor(ctx, &grpcmw.WrappedServerStream{WrappedContext: ctx}, nil, func(interface{}, grpc.ServerStream) error {
ctxlogrus.Extract(ctx).Info("verify")
return nil
diff --git a/internal/praefect/service/checks.go b/internal/praefect/service/checks.go
index 52411f318..9bf5e7bb0 100644
--- a/internal/praefect/service/checks.go
+++ b/internal/praefect/service/checks.go
@@ -130,7 +130,7 @@ func NewPostgresReadWriteCheck(conf config.Config, w io.Writer, quiet bool) *Che
if err != nil {
return fmt.Errorf("error starting transaction: %w", err)
}
- //nolint: errcheck
+ //nolint:errcheck
defer tx.Rollback()
var id int