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:
authorPavlo Strokov <pstrokov@gitlab.com>2021-08-25 12:04:05 +0300
committerPavlo Strokov <pstrokov@gitlab.com>2021-08-25 12:04:05 +0300
commitbea500b301bbec8535fbcae58c1da2d29377c666 (patch)
tree154e04485b7f70da8bfe1934c33f462ddbe8b03d
parent27293b72a99628d0b5ae27e8283891451a124748 (diff)
parent89b16e560d50dfbc532dc8c62ffe6d06a3ac32fa (diff)
Merge branch 'pks-golangci-1.42.0' into 'master'
Upgrade golangci-lint to v1.42.0 See merge request gitlab-org/gitaly!3786
-rw-r--r--.golangci.yml526
-rw-r--r--Makefile2
-rw-r--r--cmd/praefect/subcmd.go2
-rw-r--r--internal/praefect/datastore/repository_store.go4
-rw-r--r--internal/praefect/datastore/repository_store_mock.go3
-rw-r--r--internal/praefect/nodes/sql_elector_test.go2
-rw-r--r--internal/testhelper/db.go2
7 files changed, 270 insertions, 271 deletions
diff --git a/.golangci.yml b/.golangci.yml
index d0f0e9849..28b4fb2cc 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -13,7 +13,6 @@ linters:
- exportloopref
- gci
- goimports
- - golint
- gosimple
- govet
- ineffassign
@@ -22,6 +21,7 @@ linters:
- misspell
- noctx
- nolintlint
+ - revive
- rowserrcheck
- sqlclosecheck
- staticcheck
@@ -36,534 +36,534 @@ issues:
exclude-use-default: false
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
- ## BEGIN golint exclusions
+ ## BEGIN revive exclusions
##
- linters:
- - golint
+ - revive
text: "context.Context should be the first parameter of a function"
path: "_test.go"
- ## golint: Specific issues in non-*_test.go files
+ ## revive: Specific issues in non-*_test.go files
- linters:
- - golint
+ - revive
path: "client/pool_options.go"
- text: "exported type `PoolOption` should have comment or be unexported"
+ text: "exported type PoolOption should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "cmd/gitaly-git2go/conflicts/conflicts.go"
- text: "exported method `Subcommand.Flags` should have comment or be unexported"
+ text: "exported method Subcommand.Flags should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "cmd/gitaly-git2go/testhelper/testhelper.go"
- text: "exported function `BuildCommit` should have comment or be unexported"
+ text: "exported function BuildCommit should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/cgroups/noop.go"
- text: "exported method `NoopManager.Setup` should have comment or be unexported"
+ text: "exported method NoopManager.Setup should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/cgroups/noop.go"
- text: "exported method `NoopManager.AddCommand` should have comment or be unexported"
+ text: "exported method NoopManager.AddCommand should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/cgroups/noop.go"
- text: "exported method `NoopManager.Cleanup` should have comment or be unexported"
+ text: "exported method NoopManager.Cleanup should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/cgroups/v1_linux.go"
- text: "exported method `CGroupV1Manager.Setup` should have comment or be unexported"
+ text: "exported method CGroupV1Manager.Setup should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/cgroups/v1_linux.go"
- text: "exported method `CGroupV1Manager.AddCommand` should have comment or be unexported"
+ text: "exported method CGroupV1Manager.AddCommand should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/cgroups/v1_linux.go"
- text: "exported method `CGroupV1Manager.Cleanup` should have comment or be unexported"
+ text: "exported method CGroupV1Manager.Cleanup should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/command/stats.go"
- text: "exported type `Stats` should have comment or be unexported"
+ text: "exported type Stats should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/command/stats.go"
- text: "exported method `Stats.RecordSum` should have comment or be unexported"
+ text: "exported method Stats.RecordSum should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/command/stats.go"
- text: "exported method `Stats.RecordMax` should have comment or be unexported"
+ text: "exported method Stats.RecordMax should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/command/stats.go"
- text: "exported method `Stats.Fields` should have comment or be unexported"
+ text: "exported method Stats.Fields should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/command/stats.go"
- text: "exported function `StatsFromContext` should have comment or be unexported"
+ text: "exported function StatsFromContext should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/command/stats.go"
- text: "exported function `InitContextStats` should have comment or be unexported"
+ text: "exported function InitContextStats should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/config/config.go"
- text: "exported function `SkipHooks` should have comment or be unexported"
+ text: "exported function SkipHooks should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/config/config.go"
- text: "exported type `HTTPSettings` should have comment or be unexported"
+ text: "exported type HTTPSettings should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/config/ruby.go"
- text: "exported method `Duration.Duration` should have comment or be unexported"
+ text: "exported method Duration.Duration should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/config/ruby.go"
- text: "exported method `Duration.UnmarshalText` should have comment or be unexported"
+ text: "exported method Duration.UnmarshalText should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/config/ruby.go"
- text: "exported method `Duration.MarshalText` should have comment or be unexported"
+ text: "exported method Duration.MarshalText should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/hook/check.go"
- text: "exported method `GitLabHookManager.Check` should have comment or be unexported"
+ text: "exported method GitLabHookManager.Check should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/hook/manager.go"
- text: "exported method `GitLabHookManager.Describe` should have comment or be unexported"
+ text: "exported method GitLabHookManager.Describe should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/hook/manager.go"
- text: "exported method `GitLabHookManager.Collect` should have comment or be unexported"
+ text: "exported method GitLabHookManager.Collect should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/hook/postreceive.go"
- text: "exported method `GitLabHookManager.PostReceiveHook` should have comment or be unexported"
+ text: "exported method GitLabHookManager.PostReceiveHook should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/hook/referencetransaction.go"
- text: "exported method `GitLabHookManager.ReferenceTransactionHook` should have comment or be unexported"
+ text: "exported method GitLabHookManager.ReferenceTransactionHook should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/hook/update.go"
- text: "exported method `GitLabHookManager.UpdateHook` should have comment or be unexported"
+ text: "exported method GitLabHookManager.UpdateHook should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/service/internalgitaly/server.go"
- text: "exported function `NewServer` should have comment or be unexported"
+ text: "exported function NewServer should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/service/operations/apply_patch.go"
- text: "exported method `Server.UserApplyPatch` should have comment or be unexported"
+ text: "exported method Server.UserApplyPatch should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/service/operations/branches.go"
- text: "exported method `Server.UserDeleteBranch` should have comment or be unexported"
+ text: "exported method Server.UserDeleteBranch should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/service/operations/branches.go"
- text: "exported method `Server.UserCreateBranch` should have comment or be unexported"
+ text: "exported method Server.UserCreateBranch should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/service/operations/branches.go"
- text: "exported method `Server.UserUpdateBranch` should have comment or be unexported"
+ text: "exported method Server.UserUpdateBranch should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/service/operations/cherry_pick.go"
- text: "exported method `Server.UserCherryPick` should have comment or be unexported"
+ text: "exported method Server.UserCherryPick should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/service/operations/merge.go"
- text: "exported method `Server.UserFFBranch` should have comment or be unexported"
+ text: "exported method Server.UserFFBranch should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/service/operations/merge.go"
- text: "exported method `Server.UserMergeBranch` should have comment or be unexported"
+ text: "exported method Server.UserMergeBranch should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/service/operations/merge.go"
- text: "exported method `Server.UserMergeToRef` should have comment or be unexported"
+ text: "exported method Server.UserMergeToRef should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/service/operations/rebase.go"
- text: "exported method `Server.UserRebaseConfirmable` should have comment or be unexported"
+ text: "exported method Server.UserRebaseConfirmable should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/service/operations/revert.go"
- text: "exported method `Server.UserRevert` should have comment or be unexported"
+ text: "exported method Server.UserRevert should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/service/operations/server.go"
- text: "exported type `Server` should have comment or be unexported"
+ text: "exported type Server should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/service/operations/squash.go"
- text: "exported method `Server.UserSquash` should have comment or be unexported"
+ text: "exported method Server.UserSquash should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/service/operations/submodules.go"
- text: "exported method `Server.UserUpdateSubmodule` should have comment or be unexported"
+ text: "exported method Server.UserUpdateSubmodule should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/service/operations/tags.go"
- text: "exported method `Server.UserDeleteTag` should have comment or be unexported"
+ text: "exported method Server.UserDeleteTag should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/service/operations/tags.go"
- text: "exported method `Server.UserCreateTag` should have comment or be unexported"
+ text: "exported method Server.UserCreateTag should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/service/repository/commit_graph.go"
text: "exported const CommitGraphRelPath should have comment \\(or a comment on this block\\) or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/service/repository/midx.go"
text: "exported const MidxRelPath should have comment \\(or a comment on this block\\) or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/service/smarthttp/server.go"
- text: "exported function `WithPackfileNegotiationMetrics` should have comment or be unexported"
+ text: "exported function WithPackfileNegotiationMetrics should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/service/ssh/server.go"
- text: "exported function `WithPackfileNegotiationMetrics` should have comment or be unexported"
+ text: "exported function WithPackfileNegotiationMetrics should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/git/stats/packfile_negotiation.go"
- text: "exported type `PackfileNegotiation` should have comment or be unexported"
+ text: "exported type PackfileNegotiation should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/git/stats/packfile_negotiation.go"
- text: "exported function `ParsePackfileNegotiation` should have comment or be unexported"
+ text: "exported function ParsePackfileNegotiation should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/helper/ticker.go"
- text: "exported method `ManualTicker.C` should have comment or be unexported"
+ text: "exported method ManualTicker.C should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/helper/ticker.go"
- text: "exported method `ManualTicker.Stop` should have comment or be unexported"
+ text: "exported method ManualTicker.Stop should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/helper/ticker.go"
- text: "exported method `ManualTicker.Reset` should have comment or be unexported"
+ text: "exported method ManualTicker.Reset should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/helper/ticker.go"
- text: "exported method `ManualTicker.Tick` should have comment or be unexported"
+ text: "exported method ManualTicker.Tick should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/config/config.go"
- text: "exported type `Failover` should have comment or be unexported"
+ text: "exported type Failover should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/config/node.go"
- text: "exported method `Node.MarshalJSON` should have comment or be unexported"
+ text: "exported method Node.MarshalJSON should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/coordinator.go"
- text: "exported method `Coordinator.Describe` should have comment or be unexported"
+ text: "exported method Coordinator.Describe should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/coordinator.go"
- text: "exported method `Coordinator.Collect` should have comment or be unexported"
+ text: "exported method Coordinator.Collect should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/assignment.go"
- text: "exported method `AssignmentStore.GetHostAssignments` should have comment or be unexported"
+ text: "exported method AssignmentStore.GetHostAssignments should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/collector.go"
- text: "exported method `RepositoryStoreCollector.Describe` should have comment or be unexported"
+ text: "exported method RepositoryStoreCollector.Describe should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/collector.go"
- text: "exported method `RepositoryStoreCollector.Collect` should have comment or be unexported"
+ text: "exported method RepositoryStoreCollector.Collect should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/listener_postgres.go"
- text: "exported method `PostgresListener.Close` should have comment or be unexported"
+ text: "exported method PostgresListener.Close should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/listener_postgres.go"
- text: "exported method `PostgresListener.Describe` should have comment or be unexported"
+ text: "exported method PostgresListener.Describe should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/listener_postgres.go"
- text: "exported method `PostgresListener.Collect` should have comment or be unexported"
+ text: "exported method PostgresListener.Collect should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/mock.go"
- text: "exported method `MockReplicationEventQueue.Enqueue` should have comment or be unexported"
+ text: "exported method MockReplicationEventQueue.Enqueue should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/queue.go"
- text: "exported method `PostgresReplicationEventQueue.Enqueue` should have comment or be unexported"
+ text: "exported method PostgresReplicationEventQueue.Enqueue should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/queue.go"
- text: "exported method `PostgresReplicationEventQueue.Dequeue` should have comment or be unexported"
+ text: "exported method PostgresReplicationEventQueue.Dequeue should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/queue.go"
- text: "exported method `PostgresReplicationEventQueue.Acknowledge` should have comment or be unexported"
+ text: "exported method PostgresReplicationEventQueue.Acknowledge should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/queue.go"
- text: "exported method `ReplicationJob.Scan` should have comment or be unexported"
+ text: "exported method ReplicationJob.Scan should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/queue.go"
- text: "exported method `ReplicationJob.Value` should have comment or be unexported"
+ text: "exported method ReplicationJob.Value should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/repository_store.go"
- text: "exported method `PostgresRepositoryStore.GetGeneration` should have comment or be unexported"
+ text: "exported method PostgresRepositoryStore.GetGeneration should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/repository_store.go"
- text: "exported method `PostgresRepositoryStore.IncrementGeneration` should have comment or be unexported"
+ text: "exported method PostgresRepositoryStore.IncrementGeneration should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/repository_store.go"
- text: "exported method `PostgresRepositoryStore.SetGeneration` should have comment or be unexported"
+ text: "exported method PostgresRepositoryStore.SetGeneration should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/repository_store.go"
- text: "exported method `PostgresRepositoryStore.GetReplicatedGeneration` should have comment or be unexported"
+ text: "exported method PostgresRepositoryStore.GetReplicatedGeneration should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/repository_store.go"
- text: "exported method `PostgresRepositoryStore.DeleteRepository` should have comment or be unexported"
+ text: "exported method PostgresRepositoryStore.DeleteRepository should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/repository_store.go"
- text: "exported method `PostgresRepositoryStore.RenameRepository` should have comment or be unexported"
+ text: "exported method PostgresRepositoryStore.RenameRepository should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/repository_store.go"
- text: "exported method `PostgresRepositoryStore.RepositoryExists` should have comment or be unexported"
+ text: "exported method PostgresRepositoryStore.RepositoryExists should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/repository_store.go"
- text: "exported method `PostgresRepositoryStore.DeleteInvalidRepository` should have comment or be unexported"
+ text: "exported method PostgresRepositoryStore.DeleteInvalidRepository should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/repository_store.go"
- text: "exported method `PostgresRepositoryStore.GetPartiallyReplicatedRepositories` should have comment or be unexported"
+ text: "exported method PostgresRepositoryStore.GetPartiallyReplicatedRepositories should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/repository_store_mock.go"
- text: "exported method `MockRepositoryStore.RepositoryExists` should have comment or be unexported"
+ text: "exported method MockRepositoryStore.RepositoryExists should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/repository_store_mock.go"
- text: "exported method `MockRepositoryStore.GetGeneration` should have comment or be unexported"
+ text: "exported method MockRepositoryStore.GetGeneration should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/repository_store_mock.go"
- text: "exported method `MockRepositoryStore.IncrementGeneration` should have comment or be unexported"
+ text: "exported method MockRepositoryStore.IncrementGeneration should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/repository_store_mock.go"
- text: "exported method `MockRepositoryStore.GetReplicatedGeneration` should have comment or be unexported"
+ text: "exported method MockRepositoryStore.GetReplicatedGeneration should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/repository_store_mock.go"
- text: "exported method `MockRepositoryStore.SetGeneration` should have comment or be unexported"
+ text: "exported method MockRepositoryStore.SetGeneration should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/repository_store_mock.go"
- text: "exported method `MockRepositoryStore.DeleteRepository` should have comment or be unexported"
+ text: "exported method MockRepositoryStore.DeleteRepository should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/repository_store_mock.go"
- text: "exported method `MockRepositoryStore.RenameRepository` should have comment or be unexported"
+ text: "exported method MockRepositoryStore.RenameRepository should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/repository_store_mock.go"
- text: "exported method `MockRepositoryStore.GetPartiallyReplicatedRepositories` should have comment or be unexported"
+ text: "exported method MockRepositoryStore.GetPartiallyReplicatedRepositories should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/repository_store_mock.go"
- text: "exported method `MockRepositoryStore.DeleteInvalidRepository` should have comment or be unexported"
+ text: "exported method MockRepositoryStore.DeleteInvalidRepository should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/storage_provider.go"
- text: "exported method `CachingStorageProvider.Notification` should have comment or be unexported"
+ text: "exported method CachingStorageProvider.Notification should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/storage_provider.go"
- text: "exported method `CachingStorageProvider.Connected` should have comment or be unexported"
+ text: "exported method CachingStorageProvider.Connected should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/storage_provider.go"
- text: "exported method `CachingStorageProvider.Disconnect` should have comment or be unexported"
+ text: "exported method CachingStorageProvider.Disconnect should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/storage_provider.go"
- text: "exported method `CachingStorageProvider.Describe` should have comment or be unexported"
+ text: "exported method CachingStorageProvider.Describe should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/datastore/storage_provider.go"
- text: "exported method `CachingStorageProvider.Collect` should have comment or be unexported"
+ text: "exported method CachingStorageProvider.Collect should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/grpc-proxy/proxy/director.go"
- text: "exported method `StreamParameters.Primary` should have comment or be unexported"
+ text: "exported method StreamParameters.Primary should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/grpc-proxy/proxy/director.go"
- text: "exported method `StreamParameters.Secondaries` should have comment or be unexported"
+ text: "exported method StreamParameters.Secondaries should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/health_checker.go"
- text: "exported method `StaticHealthChecker.HealthyNodes` should have comment or be unexported"
+ text: "exported method StaticHealthChecker.HealthyNodes should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/metrics/prometheus.go"
- text: "exported var `MethodTypeCounter` should have comment or be unexported"
+ text: "exported var MethodTypeCounter should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/metrics/prometheus.go"
- text: "exported var `PrimaryGauge` should have comment or be unexported"
+ text: "exported var PrimaryGauge should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/metrics/prometheus.go"
- text: "exported var `NodeLastHealthcheckGauge` should have comment or be unexported"
+ text: "exported var NodeLastHealthcheckGauge should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/metrics/prometheus.go"
- text: "exported var `ChecksumMismatchCounter` should have comment or be unexported"
+ text: "exported var ChecksumMismatchCounter should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/nodes/manager.go"
- text: "exported method `Mgr.GetSyncedNode` should have comment or be unexported"
+ text: "exported method Mgr.GetSyncedNode should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/nodes/manager.go"
- text: "exported method `Mgr.HealthyNodes` should have comment or be unexported"
+ text: "exported method Mgr.HealthyNodes should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/nodes/manager.go"
- text: "exported method `Mgr.Nodes` should have comment or be unexported"
+ text: "exported method Mgr.Nodes should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/nodes/manager.go"
- text: "exported method `Shard.GetNode` should have comment or be unexported"
+ text: "exported method Shard.GetNode should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/nodes/mock.go"
- text: "exported method `MockManager.GetShard` should have comment or be unexported"
+ text: "exported method MockManager.GetShard should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/nodes/mock.go"
- text: "exported method `MockNode.GetStorage` should have comment or be unexported"
+ text: "exported method MockNode.GetStorage should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/nodes/mock.go"
- text: "exported method `MockNode.IsHealthy` should have comment or be unexported"
+ text: "exported method MockNode.IsHealthy should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/nodes/mock.go"
- text: "exported method `MockNode.GetConnection` should have comment or be unexported"
+ text: "exported method MockNode.GetConnection should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/nodes/mock.go"
- text: "exported method `MockNode.GetAddress` should have comment or be unexported"
+ text: "exported method MockNode.GetAddress should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/nodes/mock.go"
- text: "exported method `MockNode.GetToken` should have comment or be unexported"
+ text: "exported method MockNode.GetToken should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/protoregistry/protoregistry.go"
- text: "exported method `MethodInfo.FullMethodName` should have comment or be unexported"
+ text: "exported method MethodInfo.FullMethodName should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/reconciler/reconciler.go"
- text: "exported method `Reconciler.Describe` should have comment or be unexported"
+ text: "exported method Reconciler.Describe should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/reconciler/reconciler.go"
- text: "exported method `Reconciler.Collect` should have comment or be unexported"
+ text: "exported method Reconciler.Collect should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/replicator.go"
- text: "exported method `ReplMgr.Describe` should have comment or be unexported"
+ text: "exported method ReplMgr.Describe should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/replicator.go"
- text: "exported method `ReplMgr.Collect` should have comment or be unexported"
+ text: "exported method ReplMgr.Collect should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/router_per_repository.go"
- text: "exported method `PerRepositoryRouter.RouteRepositoryAccessor` should have comment or be unexported"
+ text: "exported method PerRepositoryRouter.RouteRepositoryAccessor should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/router_per_repository.go"
- text: "exported method `PerRepositoryRouter.RouteRepositoryMutator` should have comment or be unexported"
+ text: "exported method PerRepositoryRouter.RouteRepositoryMutator should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/router_per_repository.go"
- text: "exported method `StaticStorageAssignments.GetHostAssignments` should have comment or be unexported"
+ text: "exported method StaticStorageAssignments.GetHostAssignments should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/service/info/consistencycheck.go"
- text: "exported method `Server.ConsistencyCheck` should have comment or be unexported"
+ text: "exported method Server.ConsistencyCheck should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/service/info/dataloss.go"
- text: "exported method `Server.DatalossCheck` should have comment or be unexported"
+ text: "exported method Server.DatalossCheck should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/service/info/replication_factor.go"
- text: "exported method `Server.SetReplicationFactor` should have comment or be unexported"
+ text: "exported method Server.SetReplicationFactor should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/service/info/server.go"
- text: "exported method `Server.SetAuthoritativeStorage` should have comment or be unexported"
+ text: "exported method Server.SetAuthoritativeStorage should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/service/transaction/server.go"
- text: "exported type `Server` should have comment or be unexported"
+ text: "exported type Server should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/service/transaction/server.go"
- text: "exported function `NewServer` should have comment or be unexported"
+ text: "exported function NewServer should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/transactions/manager.go"
- text: "exported method `Manager.Describe` should have comment or be unexported"
+ text: "exported method Manager.Describe should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/transactions/manager.go"
- text: "exported method `Manager.Collect` should have comment or be unexported"
+ text: "exported method Manager.Collect should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/praefect/transactions/manager.go"
- text: "exported var `ErrNotFound` should have comment or be unexported"
+ text: "exported var ErrNotFound should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/gitaly/storage/locator.go"
- text: "exported var `ErrRelativePathEscapesRoot` should have comment or be unexported"
+ text: "exported var ErrRelativePathEscapesRoot should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/testhelper/promtest/counter.go"
- text: "exported method `MockCounter.Value` should have comment or be unexported"
+ text: "exported method MockCounter.Value should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/testhelper/promtest/counter.go"
- text: "exported method `MockCounter.Inc` should have comment or be unexported"
+ text: "exported method MockCounter.Inc should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/testhelper/promtest/counter.go"
- text: "exported method `MockCounter.Add` should have comment or be unexported"
+ text: "exported method MockCounter.Add should have comment or be unexported"
- linters:
- - golint
+ - revive
path: "internal/testhelper/promtest/counter.go"
- text: "exported type `MockCounter` should have comment or be unexported"
- ## END golint exclusions
+ text: "exported type MockCounter should have comment or be unexported"
+ ## END revive exclusions
##
## BEGIN errcheck exclusions
##
diff --git a/Makefile b/Makefile
index 2439c3205..59ccd76fe 100644
--- a/Makefile
+++ b/Makefile
@@ -69,7 +69,7 @@ GO_LDFLAGS := -ldflags '-X ${GITALY_PACKAGE}/internal/version.version=${G
GO_BUILD_TAGS := tracer_static,tracer_static_jaeger,tracer_static_stackdriver,continuous_profiler_stackdriver,static,system_libgit2
# Dependency versions
-GOLANGCI_LINT_VERSION ?= 1.39.0
+GOLANGCI_LINT_VERSION ?= 1.42.0
GOCOVER_COBERTURA_VERSION ?= aaee18c8195c3f2d90e5ef80ca918d265463842a
GOIMPORTS_VERSION ?= 2538eef75904eff384a2551359968e40c207d9d2
GO_JUNIT_REPORT_VERSION ?= 984a47ca6b0a7d704c4b589852051b4d7865aa17
diff --git a/cmd/praefect/subcmd.go b/cmd/praefect/subcmd.go
index dee97f487..17bd17b8d 100644
--- a/cmd/praefect/subcmd.go
+++ b/cmd/praefect/subcmd.go
@@ -38,7 +38,7 @@ var (
// subCommand returns an exit code, to be fed into os.Exit.
func subCommand(conf config.Config, arg0 string, argRest []string) int {
- interrupt := make(chan os.Signal)
+ interrupt := make(chan os.Signal, 1)
signal.Notify(interrupt, os.Interrupt)
go func() {
diff --git a/internal/praefect/datastore/repository_store.go b/internal/praefect/datastore/repository_store.go
index c59129a3b..181952194 100644
--- a/internal/praefect/datastore/repository_store.go
+++ b/internal/praefect/datastore/repository_store.go
@@ -324,8 +324,8 @@ AND storage = ANY($3)
return sourceGeneration, nil
}
-//nolint:stylecheck
-//nolint:golint
+// CreateRepository creates a new repository and assigns it to the given primary and secondary
+// nodes.
func (rs *PostgresRepositoryStore) CreateRepository(ctx context.Context, virtualStorage, relativePath, primary string, updatedSecondaries, outdatedSecondaries []string, storePrimary, storeAssignments bool) error {
const q = `
WITH repo AS (
diff --git a/internal/praefect/datastore/repository_store_mock.go b/internal/praefect/datastore/repository_store_mock.go
index 684085e5d..82edb845e 100644
--- a/internal/praefect/datastore/repository_store_mock.go
+++ b/internal/praefect/datastore/repository_store_mock.go
@@ -52,8 +52,7 @@ func (m MockRepositoryStore) SetGeneration(ctx context.Context, virtualStorage,
return m.SetGenerationFunc(ctx, virtualStorage, relativePath, storage, generation)
}
-//nolint:stylecheck
-//nolint:golint
+// CreateRepository calls the mocked function. If no mock has been provided, it returns a nil error.
func (m MockRepositoryStore) CreateRepository(ctx context.Context, virtualStorage, relativePath, primary string, updatedSecondaries, outdatedSecondaries []string, storePrimary, storeAssignments bool) error {
if m.CreateRepositoryFunc == nil {
return nil
diff --git a/internal/praefect/nodes/sql_elector_test.go b/internal/praefect/nodes/sql_elector_test.go
index 09d0a89c2..1235e9bc0 100644
--- a/internal/praefect/nodes/sql_elector_test.go
+++ b/internal/praefect/nodes/sql_elector_test.go
@@ -25,7 +25,7 @@ import (
"google.golang.org/grpc/status"
)
-var shardName string = "test-shard-0"
+var shardName = "test-shard-0"
func TestGetPrimaryAndSecondaries(t *testing.T) {
t.Parallel()
diff --git a/internal/testhelper/db.go b/internal/testhelper/db.go
index be5cb1c1e..130e39950 100644
--- a/internal/testhelper/db.go
+++ b/internal/testhelper/db.go
@@ -14,7 +14,7 @@ import (
// passed in nodes are the only ones considered healthy after the function. As the healthy nodes are determined by the time of
// the last successful health check, this should be run in the same transastion as the tested query to prevent flakiness.
//
-//nolint:golint
+//nolint:revive
func SetHealthyNodes(t testing.TB, ctx context.Context, db glsql.Querier, healthyNodes map[string]map[string][]string) {
t.Helper()