diff --git a/.golangci.yml b/.golangci.yml index fc917eb4e0..2ad72d18ed 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -18,14 +18,6 @@ run: # list of build tags, all linters use it. Default is empty list. build-tags: - # which dirs to skip: they won't be analyzed; - # can use regexp here: generated.*, regexp is applied on full path; - # default value is empty list, but next dirs are always skipped independently - # from this option's value: - # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ - skip-dirs: - - test/sdk/restapi - # which files to skip: they will be analyzed, but issues from them # won't be reported. Default value is empty list, but there is # no need to include all autogenerated files, we confidently recognize @@ -34,8 +26,15 @@ run: modules-download-mode: vendor # output configuration options output: - # colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number" - format: colored-line-number + # the formats used to render issues + # formats: colored-line-number, line-number, json, colored-tab, + # tab, html, checkstyle, code-climate, junit-xml, + # junit-xml-extended, github-actions, teamcity, sarif + # output path can be either `stdout`, `stderr` + # or path to the file to write to + formats: + - format: colored-line-number + path: stdout # print lines of code with issue, default is true print-issued-lines: true @@ -46,13 +45,11 @@ linters: enable: - bodyclose - dupl - - exportloopref - goconst - gocritic - gocyclo - goimports - govet - - megacheck - misspell - nakedret - revive @@ -88,3 +85,10 @@ issues: - path: (.+)_test\.go|^test/|^cmd/.*|^pkg/apis/.* # fieldalignment is in the `govet` linter, so exclude based on text instead of all of govet text: '^fieldalignment: .*' + + # which dirs to exclude: issues from them won't be reported + # default dirs are skipped independently of this option's value + # (see exclude-dirs-use-default) + # default: [] + exclude-dirs: + - test/sdk/restapi diff --git a/pkg/sdkserver/localsdk.go b/pkg/sdkserver/localsdk.go index 2f5a2ce4ce..a4b8b3489f 100644 --- a/pkg/sdkserver/localsdk.go +++ b/pkg/sdkserver/localsdk.go @@ -882,7 +882,7 @@ func (l *LocalSDKServer) setGameServerFromFilePath(filePath string) error { l.logger.WithField("filePath", filePath).Info("Reading GameServer configuration") reader, err := os.Open(filePath) // nolint: gosec - defer reader.Close() // nolint: megacheck,errcheck + defer reader.Close() // nolint: staticcheck,errcheck if err != nil { return err