Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update all the static check tools to latest version #1586

Closed
Madhu-1 opened this issue Oct 15, 2020 · 0 comments · Fixed by #2131
Closed

update all the static check tools to latest version #1586

Madhu-1 opened this issue Oct 15, 2020 · 0 comments · Fixed by #2131
Assignees
Labels
component/testing Additional test cases or CI work
Milestone

Comments

@Madhu-1
Copy link
Collaborator

Madhu-1 commented Oct 15, 2020

I was going through the golangci-lint new release, looks like we have some static issues its good to run all static tools with latest versions

make go-lint 
cephcsi image settings: quay.io/cephcsi/cephcsi version canary
./scripts/lint-go.sh
INFO [config_reader] Used config file scripts/golangci.yml 
INFO [lintersdb] Active 46 linters: [asciicheck bodyclose deadcode depguard dogsled errcheck exhaustive exportloopref gci gocognit goconst gocritic gocyclo godot gofmt gofumpt goheader goimports golint gomnd gomodguard goprintffuncname gosec gosimple govet ineffassign interfacer lll maligned misspell nakedret nlreturn noctx nolintlint rowserrcheck scopelint sqlclosecheck staticcheck structcheck stylecheck typecheck unconvert unparam unused varcheck whitespace] 
INFO [loader] Using build tags: [nautilus]        
INFO [loader] Go packages loading at mode 575 (compiled_files|exports_file|imports|name|deps|files|types_sizes) took 1.362612936s 
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 21.267923ms 
INFO [linters context/goanalysis] analyzers took 2m30.726592724s with top 10 stages: buildir: 2m1.340534731s, inspect: 3.066803154s, buildssa: 2.741827785s, the_only_name: 2.046159586s, exhaustive: 1.9981591s, gocritic: 1.819492945s, goimports: 1.801243659s, fact_deprecated: 1.495034764s, ctrlflow: 1.397161224s, gofumpt: 1.390896208s 
INFO [linters context/goanalysis] analyzers took 2.318403989s with top 10 stages: buildir: 2.070186758s, U1000: 248.217231ms 
WARN [runner/nolint] Found unknown linters in //nolint directives: gocognit:gocyclo 
INFO [runner/max_same_issues] 508/511 issues with text "return with no blank line before" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 52/55 issues with text "File is not `gofumpt`-ed" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 47/50 issues with text "File is not `gci`-ed with -local github.com/ceph/ceph-csi" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 38/41 issues with text "Top level comment should end in a period" were hidden, use --max-same-issues 
INFO [runner/max_same_issues] 3/6 issues with text "break with no blank line before" were hidden, use --max-same-issues 
INFO [runner] Issues before processing: 929, after processing: 21 
INFO [runner] Processors filtering stat (out/in): path_shortener: 21/21, autogenerated_exclude: 929/929, exclude: 756/929, nolint: 672/756, diff: 669/669, max_per_file_from_linter: 669/669, max_same_issues: 21/669, filename_unadjuster: 929/929, max_from_linter: 21/21, source_code: 21/21, severity-rules: 21/21, sort_results: 21/21, cgo: 929/929, skip_files: 929/929, uniq_by_line: 669/672, path_prefixer: 21/21, path_prettifier: 929/929, skip_dirs: 929/929, identifier_marker: 929/929, exclude-rules: 756/756 
INFO [runner] processing took 78.78974ms with stages: nolint: 36.903139ms, exclude: 19.474585ms, identifier_marker: 17.716477ms, path_prettifier: 1.88781ms, autogenerated_exclude: 1.598742ms, source_code: 394.804µs, cgo: 281.723µs, skip_dirs: 194.151µs, uniq_by_line: 130.242µs, max_same_issues: 111.776µs, filename_unadjuster: 49.069µs, max_per_file_from_linter: 35.453µs, max_from_linter: 5.517µs, path_shortener: 4.469µs, diff: 486ns, skip_files: 346ns, exclude-rules: 340ns, sort_results: 281ns, severity-rules: 196ns, path_prefixer: 134ns 
INFO [runner] linters took 43.53724278s with stages: goanalysis_metalinter: 41.594033125s, unused: 1.864306305s 
internal/util/crypto.go:20: File is not `gci`-ed with -local github.com/ceph/ceph-csi (gci)
	"context"
internal/util/crypto.go:28: File is not `gci`-ed with -local github.com/ceph/ceph-csi (gci)

	"crypto/rand"
internal/journal/omap.go:22: File is not `gci`-ed with -local github.com/ceph/ceph-csi (gci)

internal/util/cephconf.go:35:42: Top level comment should end in a period (godot)
	// CephConfigPath ceph configuration file
	                                        ^
internal/util/connection.go:39:14: Top level comment should end in a period (godot)
	// available)
	            ^
internal/util/crypto.go:36:49: Top level comment should end in a period (godot)
	// Encryption passphrase location in K8s secrets
	                                               ^
internal/util/credentials.go:115: File is not `gofumpt`-ed (gofumpt)
	var c = &Credentials{}
internal/util/topology.go:135: File is not `gofumpt`-ed (gofumpt)
	var (
		topologyPools []TopologyConstrainedPool
	)
internal/util/volid.go:93: File is not `gofumpt`-ed (gofumpt)
	return strings.Join([]string{versionEncodedHex, clusterIDLength, ci.ClusterID,
		poolIDEncodedHex, ci.ObjectUUID}, "-"), nil
internal/util/vault.go:309:16: G402: TLS MinVersion too low. (gosec)
	tlsConfig := &tls.Config{}
	              ^
e2e/pod.go:173:3: missing cases in switch of type v1.PodPhase: PodPending, PodUnknown (exhaustive)
		switch pod.Status.Phase {
		^
internal/journal/omap.go:74:2: return with no blank line before (nlreturn)
	return results, nil
	^
internal/journal/omap.go:69:3: return with no blank line before (nlreturn)
		return nil, err
		^
internal/journal/omap.go:67:4: return with no blank line before (nlreturn)
			return nil, util.JoinErrors(util.ErrKeyNotFound, err)
			^
internal/journal/voljournal.go:473:5: continue with no blank line before (nlreturn)
				continue
				^
internal/cephfs/volumemounter.go:126:4: break with no blank line before (nlreturn)
			break
			^
e2e/rbd.go:760:7: break with no blank line before (nlreturn)
						break
						^
internal/rbd/rbd_journal.go:411:4: break with no blank line before (nlreturn)
			break
			^
internal/rbd/rbd_util.go:468:4: continue with no blank line before (nlreturn)
			continue
			^
internal/util/util.go:137:4: continue with no blank line before (nlreturn)
			continue
			^
internal/util/vault.go:324:29: should rewrite http.NewRequestWithContext or add (*Request).WithContext (noctx)
	req, err := http.NewRequest(method, kms.VaultAddress+path, dataToSend)
	                           ^
INFO File cache stats: 98 entries of total size 818.8KiB 
INFO Memory: 394 samples, avg is 788.8MB, max is 1020.5MB 
INFO Execution took 44.962435553s                 
make: *** [Makefile:93: go-lint] Error 1
@Madhu-1 Madhu-1 added the component/testing Additional test cases or CI work label Oct 20, 2020
yati1998 added a commit to yati1998/ceph-csi that referenced this issue Apr 27, 2021
This PR updates the static check tools to
the latest version.
Further needs to resolve all the errors after
updating the version.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
yati1998 added a commit to yati1998/ceph-csi that referenced this issue Apr 28, 2021
This PR updates the static check tools to
the latest version.
Further needs to resolve all the errors after
updating the version.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
ceph-csi-bot pushed a commit to yati1998/ceph-csi that referenced this issue May 6, 2021
This PR updates the static check tools to
the latest version.
Further needs to resolve all the errors after
updating the version.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
yati1998 added a commit to yati1998/ceph-csi that referenced this issue May 10, 2021
This PR updates the static check tools to
the latest version.
Further needs to resolve all the errors after
updating the version.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
Rakshith-R added a commit to Rakshith-R/ceph-csi that referenced this issue May 24, 2021
This commit addresses ifshort linter issues which
checks if short syntax for if-statements is possible.

updates: ceph#1586

Signed-off-by: Rakshith R <rar@redhat.com>
Rakshith-R added a commit to Rakshith-R/ceph-csi that referenced this issue May 24, 2021
updates: ceph#1586

Signed-off-by: Rakshith R <rar@redhat.com>
Rakshith-R added a commit to Rakshith-R/ceph-csi that referenced this issue May 26, 2021
This commit addresses ifshort linter issues which
checks if short syntax for if-statements is possible.

updates: ceph#1586

Signed-off-by: Rakshith R <rar@redhat.com>
Rakshith-R added a commit to Rakshith-R/ceph-csi that referenced this issue May 26, 2021
updates: ceph#1586

Signed-off-by: Rakshith R <rar@redhat.com>
mergify bot pushed a commit that referenced this issue May 26, 2021
This commit addresses ifshort linter issues which
checks if short syntax for if-statements is possible.

updates: #1586

Signed-off-by: Rakshith R <rar@redhat.com>
mergify bot pushed a commit that referenced this issue May 26, 2021
updates: #1586

Signed-off-by: Rakshith R <rar@redhat.com>
Rakshith-R added a commit to Rakshith-R/ceph-csi that referenced this issue May 27, 2021
`nlreturn` linter requires a new line before return
and branch statements except when the return is alone
inside a statement group (such as an if statement) to
increase code clarity. This commit addresses such issues.

Updates: ceph#1586

Signed-off-by: Rakshith R <rar@redhat.com>
@Madhu-1 Madhu-1 added this to the release-3.4.0 milestone Jun 2, 2021
yati1998 added a commit to yati1998/ceph-csi that referenced this issue Jun 2, 2021
This PR updates the static check tools to
the latest version.
Further needs to resolve all the errors after
updating the version.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
yati1998 added a commit to yati1998/ceph-csi that referenced this issue Jun 4, 2021
This PR updates the static check tools to
the latest version.
Further needs to resolve all the errors after
updating the version.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
yati1998 added a commit to yati1998/ceph-csi that referenced this issue Jun 25, 2021
Use %w instead of %v to format errors.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
yati1998 added a commit to yati1998/ceph-csi that referenced this issue Jun 25, 2021
In few places the error is not nil still it
returns nil.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
leseb pushed a commit to yati1998/ceph-csi that referenced this issue Jun 28, 2021
Use %w instead of %v to format errors.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
leseb pushed a commit to yati1998/ceph-csi that referenced this issue Jun 28, 2021
Use %w instead of %v to format errors.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
leseb pushed a commit to yati1998/ceph-csi that referenced this issue Jun 28, 2021
In few places the error is not nil still it
returns nil.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
leseb pushed a commit to yati1998/ceph-csi that referenced this issue Jun 28, 2021
In few places the error is not nil still it
returns nil.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
mergify bot pushed a commit that referenced this issue Jun 28, 2021
In few places the error is not nil still it
returns nil.

Updates: #1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
leseb pushed a commit to yati1998/ceph-csi that referenced this issue Jul 22, 2021
this commit adds `// nolint:cyclop` for the
fucntions whose complexity is above 20

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
leseb pushed a commit to yati1998/ceph-csi that referenced this issue Jul 22, 2021
This commit disables wrapcheck and gci
linters.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
leseb pushed a commit to yati1998/ceph-csi that referenced this issue Jul 22, 2021
This commit modifies the error of godot, cyclop,
paralleltest linter caused due to merged PRs.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
yati1998 added a commit to yati1998/ceph-csi that referenced this issue Jul 22, 2021
This PR updates the static check tools to
the latest version.
Further needs to resolve all the errors after
updating the version.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
yati1998 added a commit to yati1998/ceph-csi that referenced this issue Jul 22, 2021
This commit disables the forbidigo linter as
this linter forbids the use of fmt.Printf
but we need to use it in various part of
our codebase.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
yati1998 added a commit to yati1998/ceph-csi that referenced this issue Jul 22, 2021
This commit disables gomoddirectives
linter as it bans use of replace directive.

Update: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
yati1998 added a commit to yati1998/ceph-csi that referenced this issue Jul 22, 2021
this commit adds `// nolint:cyclop` for the
fucntions whose complexity is above 20

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
yati1998 added a commit to yati1998/ceph-csi that referenced this issue Jul 22, 2021
This commit disables wrapcheck and gci
linters.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
yati1998 added a commit to yati1998/ceph-csi that referenced this issue Jul 22, 2021
This commit modifies the error of godot, cyclop,
paralleltest linter caused due to merged PRs.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
leseb pushed a commit to yati1998/ceph-csi that referenced this issue Jul 22, 2021
This PR updates the static check tools to
the latest version.
Further needs to resolve all the errors after
updating the version.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
leseb pushed a commit to yati1998/ceph-csi that referenced this issue Jul 22, 2021
This commit disables the forbidigo linter as
this linter forbids the use of fmt.Printf
but we need to use it in various part of
our codebase.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
leseb pushed a commit to yati1998/ceph-csi that referenced this issue Jul 22, 2021
This commit disables gomoddirectives
linter as it bans use of replace directive.

Update: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
leseb pushed a commit to yati1998/ceph-csi that referenced this issue Jul 22, 2021
this commit adds `// nolint:cyclop` for the
fucntions whose complexity is above 20

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
leseb pushed a commit to yati1998/ceph-csi that referenced this issue Jul 22, 2021
This commit disables wrapcheck and gci
linters.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
leseb pushed a commit to yati1998/ceph-csi that referenced this issue Jul 22, 2021
This commit modifies the error of godot, cyclop,
paralleltest linter caused due to merged PRs.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
@mergify mergify bot closed this as completed in #2131 Jul 22, 2021
mergify bot pushed a commit that referenced this issue Jul 22, 2021
This PR updates the static check tools to
the latest version.
Further needs to resolve all the errors after
updating the version.

Updates: #1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
mergify bot pushed a commit that referenced this issue Jul 22, 2021
This commit disables the forbidigo linter as
this linter forbids the use of fmt.Printf
but we need to use it in various part of
our codebase.

Updates: #1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
mergify bot pushed a commit that referenced this issue Jul 22, 2021
This commit disables gomoddirectives
linter as it bans use of replace directive.

Update: #1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
mergify bot pushed a commit that referenced this issue Jul 22, 2021
this commit adds `// nolint:cyclop` for the
fucntions whose complexity is above 20

Updates: #1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
mergify bot pushed a commit that referenced this issue Jul 22, 2021
This commit disables wrapcheck and gci
linters.

Updates: #1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
mergify bot pushed a commit that referenced this issue Jul 22, 2021
This commit modifies the error of godot, cyclop,
paralleltest linter caused due to merged PRs.

Updates: #1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
nixpanic pushed a commit to red-hat-storage/ceph-csi that referenced this issue Aug 9, 2021
nlreturn linter requires a new line before return
and branch statements except when the return is alone
inside a statement group (such as an if statement) to
increase code clarity. This commit addresses such issues.

Updates: ceph#1586

Signed-off-by: Rakshith R <rar@redhat.com>
nixpanic pushed a commit to red-hat-storage/ceph-csi that referenced this issue Aug 9, 2021
This PR updates the static check tools to
the latest version.
Further needs to resolve all the errors after
updating the version.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
nixpanic pushed a commit to red-hat-storage/ceph-csi that referenced this issue Aug 9, 2021
This commit disables the forbidigo linter as
this linter forbids the use of fmt.Printf
but we need to use it in various part of
our codebase.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
nixpanic pushed a commit to red-hat-storage/ceph-csi that referenced this issue Aug 9, 2021
This commit disables gomoddirectives
linter as it bans use of replace directive.

Update: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
nixpanic pushed a commit to red-hat-storage/ceph-csi that referenced this issue Aug 9, 2021
this commit adds `// nolint:cyclop` for the
fucntions whose complexity is above 20

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
nixpanic pushed a commit to red-hat-storage/ceph-csi that referenced this issue Aug 9, 2021
This commit disables wrapcheck and gci
linters.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
nixpanic pushed a commit to red-hat-storage/ceph-csi that referenced this issue Aug 9, 2021
This commit modifies the error of godot, cyclop,
paralleltest linter caused due to merged PRs.

Updates: ceph#1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/testing Additional test cases or CI work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants