Skip to content

Commit a2b9012

Browse files
committed
Close #196: disable GAS (gosec) by default
1 parent faa7599 commit a2b9012

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ errcheck: Errcheck is a program for checking for unchecked errors in go programs
9999
staticcheck: Staticcheck is a go vet on steroids, applying a ton of static analysis checks [fast: false]
100100
unused: Checks Go code for unused constants, variables, functions and types [fast: false]
101101
gosimple: Linter for Go source code that specializes in simplifying a code [fast: false]
102-
gas: Inspects source code for security problems [fast: false]
103102
structcheck: Finds an unused struct fields [fast: false]
104103
varcheck: Finds unused global variables and constants [fast: false]
105104
ineffassign: Detects when assignments to existing variables are not used [fast: true]
@@ -113,6 +112,7 @@ $ golangci-lint help linters
113112
...
114113
Disabled by default linters:
115114
golint: Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes [fast: true]
115+
gas: Inspects source code for security problems [fast: false]
116116
interfacer: Linter that suggests narrower interface types [fast: false]
117117
unconvert: Remove unnecessary type conversions [fast: false]
118118
dupl: Tool for code clone detection [fast: true]
@@ -291,7 +291,6 @@ golangci-lint help linters
291291
- [staticcheck](https://staticcheck.io/) - Staticcheck is a go vet on steroids, applying a ton of static analysis checks
292292
- [unused](https://github.com/dominikh/go-tools/tree/master/cmd/unused) - Checks Go code for unused constants, variables, functions and types
293293
- [gosimple](https://github.com/dominikh/go-tools/tree/master/cmd/gosimple) - Linter for Go source code that specializes in simplifying a code
294-
- [gas](https://github.com/GoASTScanner/gas) - Inspects source code for security problems
295294
- [structcheck](https://github.com/opennota/check) - Finds an unused struct fields
296295
- [varcheck](https://github.com/opennota/check) - Finds unused global variables and constants
297296
- [ineffassign](https://github.com/gordonklaus/ineffassign) - Detects when assignments to existing variables are not used
@@ -300,6 +299,7 @@ golangci-lint help linters
300299

301300
## Disabled By Default Linters (`-E/--enable`)
302301
- [golint](https://github.com/golang/lint) - Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes
302+
- [gas](https://github.com/GoASTScanner/gas) - Inspects source code for security problems
303303
- [interfacer](https://github.com/mvdan/interfacer) - Linter that suggests narrower interface types
304304
- [unconvert](https://github.com/mdempsky/unconvert) - Remove unnecessary type conversions
305305
- [dupl](https://github.com/mibk/dupl) - Tool for code clone detection

pkg/lint/lintersdb/lintersdb.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,20 +187,20 @@ func GetAllSupportedLinterConfigs() []linter.Config {
187187
WithURL("https://github.com/alexkohler/prealloc"),
188188
}
189189

190+
isLocalRun := os.Getenv("GOLANGCI_COM_RUN") == ""
190191
enabled := map[string]bool{
191192
golinters.Govet{}.Name(): true,
192193
golinters.Errcheck{}.Name(): true,
193194
golinters.Megacheck{StaticcheckEnabled: true}.Name(): true,
194195
golinters.Megacheck{UnusedEnabled: true}.Name(): true,
195196
golinters.Megacheck{GosimpleEnabled: true}.Name(): true,
196-
golinters.Gas{}.Name(): true,
197197
golinters.Structcheck{}.Name(): true,
198198
golinters.Varcheck{}.Name(): true,
199199
golinters.Ineffassign{}.Name(): true,
200200
golinters.Deadcode{}.Name(): true,
201201

202202
// don't typecheck for golangci.com: too many troubles
203-
golinters.TypeCheck{}.Name(): os.Getenv("GOLANGCI_COM_RUN") == "",
203+
golinters.TypeCheck{}.Name(): isLocalRun,
204204
}
205205
return enableLinterConfigs(lcs, func(lc *linter.Config) bool {
206206
return enabled[lc.Linter.Name()]

0 commit comments

Comments
 (0)