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

fix most staticcheck warnings #989

Closed
wants to merge 14 commits into from
Closed

fix most staticcheck warnings #989

wants to merge 14 commits into from

Conversation

gfr10598
Copy link
Contributor

@gfr10598 gfr10598 commented Apr 19, 2021

This PR fixes most of the warnings issued by the staticcheck tool.
There are a few warnings left, primarily for unused err values.

Testing:
Successful build + unit test coverage should be adequate, since these are expected to be strict refactorings and dead code deletions.
Test coverage stats should be checked to ensure modified lines are actually covered by unit tests.


This change is Reviewable

@gfr10598 gfr10598 requested a review from SaiedKazemi April 19, 2021 19:48
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 6422

  • 33 of 72 (45.83%) changed or added relevant lines in 12 files are covered.
  • 5 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.2%) to 62.69%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cmd/etl_worker/etl_worker.go 19 20 95.0%
cmd/generate_schema_docs/main.go 0 1 0.0%
etl/globals.go 2 3 66.67%
parser/annotation.go 0 1 0.0%
storage/rowwriter.go 4 5 80.0%
schema/pt_schema.go 0 2 0.0%
web100/tcpkis.go 0 2 0.0%
parser/ss.go 0 3 0.0%
schema/web100.go 0 3 0.0%
parser/pt.go 6 14 42.86%
Files with Coverage Reduction New Missed Lines %
parser/pt.go 1 75.33%
schema/web100.go 1 0%
active/poller.go 3 67.86%
Totals Coverage Status
Change from base Build 6411: 0.2%
Covered Lines: 3468
Relevant Lines: 5532

💛 - Coveralls

Copy link
Member

@SaiedKazemi SaiedKazemi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 36 of 38 files at r1.
Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @gfr10598)


fake/fold.go, line 103 at r1 (raw file):

	}
	return len(t) >= 0

This doesn't look correct to me. If len(t) is 1, the old code returns false but this code returns true. Right?


storage/rowwriter.go, line 29 at r1 (raw file):

	o stiface.ObjectHandle

	// this attribute struct can be used to accumulate attributes that

Nit: can you capitalize? Go Style Decision: "Comments that are complete sentences should be capitalized and punctuated like standard English sentences."

Copy link
Contributor Author

@gfr10598 gfr10598 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @gfr10598)


fake/fold.go, line 103 at r1 (raw file):

	}
	return len(t) >= 0

True enough - and no test coverage. 8-(

@stephen-soltesz
Copy link
Contributor

Closing this PR to clean up old PRs - the work to normalize the ETL codebases with standard Go static checks can be tracked in #1081

@stephen-soltesz stephen-soltesz deleted the staticcheck branch August 12, 2022 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants