3 Star 4 Fork 0

cloudiac / cloudiac

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
.golangci.yml 2.80 KB
一键复制 编辑 原始数据 按行查看 历史
jinxing 提交于 2022-03-03 15:56 . chore(lint): 开启 errorlint (#360)
# Reference: https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
run:
# Which dirs to skip: issues from them won't be reported.
# Can use regexp here: `generated.*`, regexp is applied on full path.
# Default value is empty list,
# but default dirs are skipped independently of this option's value (see skip-dirs-use-default).
# "/" will be replaced by current OS file path separator to properly work on Windows.
skip-dirs:
- var
# Which files to skip: they will be analyzed, but issues from them won't be reported.
# Default value is empty list,
# but there is no need to include all autogenerated files,
# we confidently recognize autogenerated files.
# If it's not please let us know.
# "/" will be replaced by current OS file path separator to properly work on Windows.
skip-files:
- ".+_test\\.go$"
linters-settings:
goheader:
# Supports two types 'const` and `regexp`.
# Values can be used recursively.
values:
const:
# Define here const type values in format k:v.
# For example:
# COMPANY: Hangzhou Yunji Technology Co., Ltd.
regexp:
# Define here regexp type values.
# for example:
# AUTHOR: .*@idcos\.com
# The template use for checking.
template: |-
Copyright (c) {{YEAR-RANGE}} CloudJ Technology Co., Ltd.
# As alternative of directive 'template', you may put the path to file with the template source.
# Useful if you need to load the template from a specific file.
#template-path: /path/to/my/template.tmpl
cyclop:
# The maximal code complexity to report.
max-complexity: 15
# The maximal average package complexity.
# If it's higher than 0.0 (float) the check is enabled
# Default: 0.0
package-average: 0.0
# Should ignore tests.
# Default: false
skip-tests: false
errorlint:
# Check whether fmt.Errorf uses the %w verb for formatting errors.
# See the https://github.com/polyfloyd/go-errorlint for caveats.
# Default: true
errorf: false
# Check for plain type assertions and type switches.
# Default: true
asserts: true
# Check for plain error comparisons.
# Default: true
comparison: true
linters:
# Disable all linters.
# disable-all: true
# Enable specific linter
# https://golangci-lint.run/usage/linters/#enabled-by-default-linters
enable:
- deadcode
- errcheck
- errorlint
- goheader
- gosimple
- gosec
- govet
- ineffassign
- staticcheck
- structcheck
- typecheck
- unused
- varcheck
- dupl
- cyclop
issues:
# Maximum issues count per one linter.
# Set to 0 to disable.
# Default: 50
max-issues-per-linter: 0
# Maximum count of issues with the same text.
# Set to 0 to disable.
# Default: 3
max-same-issues: 0
Go
1
https://gitee.com/cloudiac/cloudiac.git
git@gitee.com:cloudiac/cloudiac.git
cloudiac
cloudiac
cloudiac
master

搜索帮助