-
Notifications
You must be signed in to change notification settings - Fork 16
/
.golangci.yml
71 lines (66 loc) · 3.01 KB
/
.golangci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
run:
timeout: 60m
go: 1.23
modules-download-mode: vendor
skip-dirs:
- /sdk/ # Excluding sdk folders as these are externally generated
skip-files:
- "internal/services/.*/.*_gen.go$"
issues:
max-per-linter: 0
max-same-issues: 0
linters:
disable-all: true
enable:
- asasalint # check for pass []any as any in variadic func(...any)
- asciicheck # ensure code does not contain non-ASCII identifiers
- bidichk # checks for dangerous unicode character sequences
- decorder # check declaration order and count of types, constants, variables and functions.
- durationcheck # check for common mistakes when working with time.Duration
- dupword # check for duplicated words in comments
- errcheck # checking for unchecked errors
- gocritic # linter for Go source code that specializes in simplifying code
- gofmt # checks whether code was gofmt-ed
- gofumpt # checks whether code was gofumpt-ed, a stricter gofmt
- goimports # check import statements are formatted according to the 'goimport' command
- gosimple # linter for Go source code that specializes in simplifying code.
- govet # reports suspicious constructs. It is roughly the same as 'go vet' (replaced vet and vetshadow)
- ineffassign # detects when assignments to existing variables are not used
- misspell # finds commonly misspelled English words.
#- nilerr # Finds the code that returns nil even if it checks that the error is not nil.
#- nlreturn # Nlreturn checks for a new line before return and branch statements to increase code clarity.
- prealloc # finds slice declarations that could potentially be pre-allocated.
- predeclared # find code that shadows one of Go's predeclared identifiers.
- reassign # checks that package variables are not reassigned.
#- revive #Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint.
- tagalign # checks struct tags that do not align with the specified column in struct definitions.
- staticcheck # checks rules from staticcheck. It's not the same thing as the staticcheck binary.
- unused # checks Go code for unused constants, variables, functions and types.
- unconvert # checks for unnecessary type conversions.
- unparam # reports unused function parameters.
- wastedassign # finds wasted assignment statements
- whitespace # checks for unnecessary newlines at the start and end of functions, if, for, etc. (
#- wsl # add or remove empty lines.
linters-settings:
errcheck:
ignore: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema:ForceNew|Set,fmt:.*,io:Close
misspell:
ignore-words:
- hdinsight
- exportfs
nakedret:
max-func-lines: 30
tagalign:
sort: true
order:
- json
- tfschema
- computed
predeclared:
ignore: new,min,max # should we use newer, minimum, and maximum instead?
revive:
rules:
- name: var-naming
disabled: true