Skip to content

Commit 6722bd5

Browse files
tenthirtyamlbajolet-hashicorp
authored andcommitted
chore: update golangci.yml
Updates deprecated configurations and removes redundant or default settings. Signed-off-by: Ryan Johnson <ryan.johnson@broadcom.com>
1 parent 58d9b55 commit 6722bd5

1 file changed

Lines changed: 15 additions & 98 deletions

File tree

.golangci.yml

Lines changed: 15 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,18 @@
11
# Copyright (c) HashiCorp, Inc.
22
# SPDX-License-Identifier: MPL-2.0
33

4-
issues:
5-
# List of regexps of issue texts to exclude, empty list by default.
6-
# But independently from this option we use default exclude patterns,
7-
# it can be disabled by `exclude-use-default: false`. To list all
8-
# excluded by default patterns execute `golangci-lint run --help`
4+
# For more information about the golangci-lint configuration file, refer to:
5+
# https://golangci-lint.run/usage/configuration/
96

7+
issues:
108
exclude-rules:
11-
# Exclude gosimple bool check
12-
- linters:
13-
- gosimple
14-
text: "S(1002|1008|1021)"
15-
# Exclude failing staticchecks for now
16-
- linters:
17-
- staticcheck
18-
text: "SA(1006|1019|4006|4010|4017|5007|6005|9004):"
19-
# Exclude lll issues for long lines with go:generate
20-
- linters:
21-
- lll
9+
# Exclude staticcheck for some rules.
10+
- linters: [staticcheck]
11+
text: "SA1006|SA1019|SA4006|SA4010|SA4017|SA5007|SA6005|SA9004"
12+
# Exclude line length linter for generated files.
13+
- linters: [lll]
2214
source: "^//go:generate "
2315

24-
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
25-
max-issues-per-linter: 0
26-
27-
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
28-
max-same-issues: 0
29-
3016
linters:
3117
disable-all: true
3218
enable:
@@ -38,88 +24,19 @@ linters:
3824
- staticcheck
3925
- unconvert
4026
- unused
41-
fast: true
4227

43-
# options for analysis running
4428
run:
45-
# default concurrency is a available CPU number
4629
concurrency: 4
47-
48-
# timeout for analysis, e.g. 30s, 5m, default is 1m
4930
timeout: 10m
50-
51-
# exit code when at least one issue was found, default is 1
52-
issues-exit-code: 1
53-
54-
# include test files or not, default is true
55-
tests: true
56-
57-
# list of build tags, all linters use it. Default is empty list.
58-
#build-tags:
59-
# - mytag
60-
61-
# which dirs to skip: issues from them won't be reported;
62-
# can use regexp here: generated.*, regexp is applied on full path;
63-
# default value is empty list, but default dirs are skipped independently
64-
# from this option's value (see skip-dirs-use-default).
65-
#skip-dirs:
66-
# - src/external_libs
67-
# - autogenerated_by_my_lib
68-
69-
# default is true. Enables skipping of directories:
70-
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
71-
skip-dirs-use-default: true
72-
73-
# which files to skip: they will be analyzed, but issues from them
74-
# won't be reported. Default value is empty list, but there is
75-
# no need to include all autogenerated files, we confidently recognize
76-
# autogenerated files. If it's not please let us know.
77-
skip-files:
31+
exclude-files:
7832
- ".*\\.hcl2spec\\.go$"
79-
# - lib/bad.go
80-
81-
# by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules":
82-
# If invoked with -mod=readonly, the go command is disallowed from the implicit
83-
# automatic updating of go.mod described above. Instead, it fails when any changes
84-
# to go.mod are needed. This setting is most useful to check that go.mod does
85-
# not need updates, such as in a continuous integration and testing system.
86-
# If invoked with -mod=vendor, the go command assumes that the vendor
87-
# directory holds the correct copies of dependencies and ignores
88-
# the dependency descriptions in go.mod.
89-
# modules-download-mode: vendor
90-
9133

92-
# output configuration options
9334
output:
94-
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
95-
format: colored-line-number
96-
97-
# print lines of code with issue, default is true
98-
print-issued-lines: true
99-
100-
# print linter name in the end of issue text, default is true
101-
print-linter-name: true
35+
formats:
36+
- format: colored-line-number
10237

103-
# make issues output unique by line, default is true
104-
uniq-by-line: true
105-
106-
107-
# all available settings of specific linters
10838
linters-settings:
109-
errcheck:
110-
# report about not checking of errors in type assetions: `a := b.(MyStruct)`;
111-
# default is false: such cases aren't reported by default.
112-
check-type-assertions: false
113-
114-
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
115-
# default is false: such cases aren't reported by default.
116-
check-blank: false
117-
118-
# [deprecated] comma-separated list of pairs of the form pkg:regex
119-
# the regex is used to ignore names within pkg. (default "fmt:.*").
120-
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
121-
ignore: fmt:.*,io/ioutil:^Read.*,io:Close
122-
123-
# path to a file containing a list of functions to exclude from checking
124-
# see https://github.com/kisielk/errcheck#excluding-functions for details
125-
#exclude: /path/to/file.txt
39+
errcheck:
40+
exclude-functions:
41+
- "fmt:.*"
42+
- "io:Close"

0 commit comments

Comments
 (0)