You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: .golangci.yml
+48-15
Original file line number
Diff line number
Diff line change
@@ -40,9 +40,11 @@ linters:
40
40
- errcheck # Errcheck is a program for checking for unchecked errors in go programs.
41
41
- errchkjson # Checks types passed to the JSON encoding functions. Reports unsupported types and optionally reports occasions, where the check for the returned error can be omitted.
42
42
- funlen # Tool for detection of long functions
43
+
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification
44
+
- goimports # Check import statements are formatted according to the 'goimport' command. Reformat imports in autofix mode.
45
+
- gci # Gci controls Go package import order and makes it always deterministic.
43
46
- goconst # Finds repeated strings that could be replaced by a constant
44
47
- gocritic # Provides diagnostics that check for bugs, performance and style issues.
45
-
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification
46
48
- gosimple # Linter for Go source code that specializes in simplifying code
47
49
- govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
48
50
- misspell # Finds commonly misspelled English words in comments
@@ -79,7 +81,51 @@ linters-settings:
79
81
locale: US
80
82
ignore-words:
81
83
- cancelled
82
-
84
+
# https://golangci-lint.run/usage/linters/#gofmt
85
+
gofmt:
86
+
# Simplify code: gofmt with `-s` option.
87
+
# Default: true
88
+
simplify: true
89
+
# Apply the rewrite rules to the source before reformatting.
90
+
# https://pkg.go.dev/cmd/gofmt
91
+
# Default: []
92
+
rewrite-rules: [ ]
93
+
# - pattern: 'interface{}'
94
+
# replacement: 'any'
95
+
# - pattern: 'a[b:len(a)]'
96
+
# replacement: 'a[b:]'
97
+
goimports:
98
+
# A comma-separated list of prefixes, which, if set, checks import paths
99
+
# with the given prefixes are grouped after 3rd-party packages.
100
+
# Default: ""
101
+
local-prefixes: github.com/gogf/gf/v2
102
+
gci:
103
+
# Section configuration to compare against.
104
+
# Section names are case-insensitive and may contain parameters in ().
105
+
# The default order of sections is `standard > default > custom > blank > dot > alias > localmodule`,
106
+
# If `custom-order` is `true`, it follows the order of `sections` option.
107
+
# Default: ["standard", "default"]
108
+
sections:
109
+
- standard # Standard section: captures all standard packages.
110
+
- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
111
+
- default # Default section: contains all imports that could not be matched to another section type.
112
+
- dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
113
+
# - alias # Alias section: contains all alias imports. This section is not present unless explicitly enabled.
114
+
# - localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled.
115
+
- prefix(github.com/gogf/gf) # Custom section: groups all imports with the specified Prefix.
116
+
- prefix(github.com/gogf/gf/cmd) # Custom section: groups all imports with the specified Prefix.
117
+
- prefix(github.com/gogf/gfcontrib) # Custom section: groups all imports with the specified Prefix.
118
+
- prefix(github.com/gogf/gf/example) # Custom section: groups all imports with the specified Prefix.
119
+
# Skip generated files.
120
+
# Default: true
121
+
skip-generated: true
122
+
# Enable custom order of sections.
123
+
# If `true`, make the section order the same as the order of `sections`.
0 commit comments