-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #262 from ackama:setup-linting
PiperOrigin-RevId: 695612866
- Loading branch information
Showing
3 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# TODO(#274): this should match the configuration of osv-scanner for the most part | ||
# currently it does not because using that config raises type errors, | ||
# in addition to some of the rules having violations that need addressing, | ||
# so the current focus is on getting as many linters as possible running | ||
|
||
output: | ||
sort-results: true | ||
linters: | ||
# TODO(#274): currently linting raises a type error, so until that's resolved we've got to be very selective in what we enable | ||
enable: | ||
- asasalint | ||
- asciicheck | ||
- bidichk | ||
- bodyclose | ||
- canonicalheader | ||
# - containedctx | ||
# - contextcheck | ||
# - copyloopvar | ||
- decorder | ||
# - depguard | ||
- dogsled | ||
# - dupl | ||
# - dupword | ||
- durationcheck | ||
# - errcheck | ||
# - errchkjson | ||
# - errname | ||
# - errorlint | ||
# - exhaustive | ||
# - fatcontext | ||
# - forbidigo | ||
- ginkgolinter | ||
- gocheckcompilerdirectives | ||
# - gochecknoinits | ||
- gochecksumtype | ||
# - gocritic | ||
# - gofmt | ||
- goheader | ||
# - goimports | ||
- gomoddirectives | ||
- gomodguard | ||
- goprintffuncname | ||
# - gosec | ||
# - gosimple | ||
- gosmopolitan | ||
# - govet | ||
- grouper | ||
- importas | ||
# - inamedparam | ||
# - ineffassign | ||
- interfacebloat | ||
# - intrange | ||
- loggercheck | ||
- makezero | ||
- mirror | ||
# - misspell | ||
# - musttag | ||
- nakedret | ||
# - nilerr | ||
# - nilnil | ||
# - nlreturn | ||
# - noctx | ||
- nolintlint | ||
# - nosprintfhostport | ||
# - paralleltest | ||
# - perfsprint | ||
# - prealloc | ||
# - predeclared | ||
- promlinter | ||
# - protogetter | ||
- reassign | ||
# - revive | ||
- rowserrcheck | ||
- sloglint | ||
- spancheck | ||
- sqlclosecheck | ||
# - staticcheck | ||
# - stylecheck | ||
- tagalign | ||
- tenv | ||
- testableexamples | ||
- testifylint | ||
# - thelper | ||
# - tparallel | ||
# - unconvert | ||
# - unparam | ||
# - unused | ||
# - usestdlibvars | ||
# - wastedassign | ||
# - whitespace | ||
- zerologlint | ||
disable-all: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,9 @@ scalibr: | |
# go-sqlite3 used by the RPM extractor. | ||
CGO_ENABLED=1 go build binary/scalibr/scalibr.go | ||
|
||
lint: | ||
go run github.com/golangci/golangci-lint/cmd/[email protected] run ./... --max-same-issues 0 | ||
|
||
test: | ||
CGO_ENABLED=1 go test ./... | ||
|
||
|