Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

make check is failing on main #948

Closed
joshrosso opened this issue Jul 6, 2021 · 3 comments
Closed

make check is failing on main #948

joshrosso opened this issue Jul 6, 2021 · 3 comments
Labels
good-first-issue Good for newcomers help-wanted Looking for contributors to help kind/bug A bug in an existing capability triage/needs-triage Needs triage by TCE maintainers

Comments

@joshrosso
Copy link
Contributor

Bug Report

make -C hack/tools golangci-lint
make[1]: Entering directory '/home/josh/d/tce/hack/tools'
make[1]: Nothing to be done for 'golangci-lint'.
make[1]: Leaving directory '/home/josh/d/tce/hack/tools'
hack/tools/bin/golangci-lint run -v --timeout=5m
INFO [config_reader] Config search paths: [./ /home/josh/d/tce /home/josh/d /home/josh /home /]
INFO [config_reader] Used config file .golangci.yaml
INFO [lintersdb] Active 35 linters: [bodyclose deadcode depguard dogsled dupl errcheck funlen goconst gocritic gocyclo gofmt goheader goimports golint gomnd goprintffuncname
gosec gosimple govet ineffassign maligned misspell nakedret noctx nolintlint rowserrcheck staticcheck structcheck stylecheck typecheck unconvert unparam unused varcheck whitespace]
INFO [loader] Go packages loading at mode 575 (types_sizes|compiled_files|exports_file|files|imports|deps|name) took 336.840329ms
ERRO Running error: context loading failed: no go files to analyze
INFO Memory: 5 samples, avg is 71.3MB, max is 71.3MB
INFO Execution took 339.812324ms
make: *** [Makefile:116: lint] Error 5

Expected Behavior

make check to find the go files and pass/fail based on evaluation.

Steps to Reproduce the Bug

Run make check

@joshrosso joshrosso added kind/bug A bug in an existing capability good-first-issue Good for newcomers help-wanted Looking for contributors to help triage/needs-triage Needs triage by TCE maintainers labels Jul 6, 2021
@joshrosso
Copy link
Contributor Author

This is broken due to the inclusion of hack/packages/*.go in https://github.com/vmware-tanzu/tce/pull/793/files

cc @seemiller

@jpmcb
Copy link
Contributor

jpmcb commented Jul 6, 2021

There are missing go.sum entries for the go files under hack/packages/.

After running go mod download && go mod tidy I noted that both go.mod and go.sum were updated off main.

Then running make check correctly linted the hack/packages/*.go files:

INFO [runner] linters took 439.59021ms with stages: goanalysis_metalinter: 389.243413ms, unused: 42.267553ms
hack/packages/generate-package-repository.go:108:25: Error return value of `outputFile.WriteString` is not checked (errcheck)
                outputFile.WriteString("---\n")
                                      ^
hack/packages/generate-package-repository.go:110:18: Error return value of `outputFile.Write` is not checked (errcheck)
        outputFile.Write(source)
                        ^
hack/packages/generate-package-repository.go:24: File is not `gofmt`-ed with `-s` (gofmt)
        APIVersion string `json:"apiVersion"`
        Kind       string `json:"kind"`
        Bundle BundleRef `json:"bundle"` // This generated yaml, but due to lib we need to use `json`
hack/packages/generate-package-repository.go:1: Missed header for check (goheader)
package main
hack/packages/generate-package-repository.go:62:14: ineffectual assignment to `err` (ineffassign)
        outputFile, err := os.Create(outputPackageYaml)
                    ^
hack/packages/generate-package-repository.go:20:2: structtag: struct field tag `packages` not compatible with reflect.StructTag.Get: bad syntax for struct tag pair (govet)
        Packages []Package `packages`
        ^
hack/packages/generate-package-repository.go:47:15: SA1006: printf-style function with dynamic format string and no further arguments should use print-style function instead (staticcheck)
        os.RemoveAll(fmt.Sprintf(channelDir))
                     ^
INFO File cache stats: 2 entries of total size 6.3KiB
INFO Memory: 18 samples, avg is 91.6MB, max is 140.4MB
INFO Execution took 1.641306498s
make: *** [Makefile:116: lint] Error 1

@jpmcb
Copy link
Contributor

jpmcb commented Jul 19, 2021

This was fixed in #960

@jpmcb jpmcb closed this as completed Jul 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good-first-issue Good for newcomers help-wanted Looking for contributors to help kind/bug A bug in an existing capability triage/needs-triage Needs triage by TCE maintainers
Projects
None yet
Development

No branches or pull requests

2 participants