11 Star 46 Fork 0

Gitee 极速下载/consul

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/hashicorp/consul
克隆/下载
.golangci.yml 3.66 KB
一键复制 编辑 原始数据 按行查看 历史
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1
linters:
disable-all: true
enable:
- gofmt
- govet
- unconvert
- staticcheck
- ineffassign
- unparam
- forbidigo
- gomodguard
- depguard
issues:
# Disable the default exclude list so that all excludes are explicitly
# defined in this file.
exclude-use-default: false
exclude-rules:
# Temp Ignore SA9004: only the first constant in this group has an explicit type
# https://staticcheck.io/docs/checks#SA9004
- linters: [staticcheck]
text: "SA9004:"
- linters: [staticcheck]
text: 'SA1019: "io/ioutil" has been deprecated since Go 1.16'
# Allow usage of deprecated values.
- linters: [ staticcheck ]
text: 'SA1019:'
path: "(agent/grpc-external|agent/grpc-internal)"
# An argument that always receives the same value is often not a problem.
- linters: [unparam]
text: "always receives"
# Often functions will implement an interface that returns an error without
# needing to return an error. Sometimes the error return value is unnecessary
# but a linter can not tell the difference.
- linters: [unparam]
text: 'result \d+ \(error\) is always nil'
# Allow unused parameters to start with an underscore. Arguments with a name
# of '_' are already ignored.
# Ignoring longer names that start with underscore allow for better
# self-documentation than a single underscore by itself. Underscore arguments
# should generally only be used when a function is implementing an interface.
- linters: [unparam]
text: "`_[^`]*` is unused"
# Temp ignore some common unused parameters so that unparam can be added
# incrementally.
- linters: [unparam]
text: "`(t|resp|req|entMeta)` is unused"
# Temp ignore everything in _ce(_test).go and _ent(_test).go. Many of these
# could use underscore to ignore the unused arguments, but the "always returns"
# issue will likely remain in CE, and will need to be excluded.
- linters: [unparam]
path: "(_ce.go|_ce_test.go|_ent.go|_ent_test.go)"
linters-settings:
govet:
check-shadowing: true
enable-all: true
disable:
- fieldalignment
- nilness
- shadow
- unusedwrite
gofmt:
simplify: true
forbidigo:
# Forbid the following identifiers (list of regexp).
# Format includes custom message based on https://github.com/ashanbrown/forbidigo/pull/11
forbid:
- '\bhtml\/template\b(# Use text/template instead)?'
- '\bioutil\b(# Use io and os packages instead of ioutil)?'
- '\brequire\.New\b(# Use package-level functions with explicit TestingT)?'
- '\bassert\.New\b(# Use package-level functions with explicit TestingT)?'
# Exclude godoc examples from forbidigo checks.
# Default: true
exclude_godoc_examples: false
gomodguard:
blocked:
# List of blocked modules.
modules:
# Blocked module.
- github.com/hashicorp/net-rpc-msgpackrpc:
recommendations:
- github.com/hashicorp/consul-net-rpc/net-rpc-msgpackrpc
- github.com/hashicorp/go-msgpack:
recommendations:
- github.com/hashicorp/consul-net-rpc/go-msgpack
- github.com/golang/protobuf:
recommendations:
- google.golang.org/protobuf
depguard:
rules:
main:
listMode: lax
deny:
- pkg: net/rpc
desc: "only use forked copy in github.com/hashicorp/consul-net-rpc/net/rpc"
- pkg: github.com/golang/protobuf
desc: "only use google.golang.org/protobuf"
run:
timeout: 10m
concurrency: 4
skip-dirs-use-default: false
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors/consul.git
git@gitee.com:mirrors/consul.git
mirrors
consul
consul
main

搜索帮助

D67c1975 1850385 1daf7b77 1850385