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 some of the Go Report Card findings #538

Merged
merged 8 commits into from
Jan 21, 2021
Merged

Fix some of the Go Report Card findings #538

merged 8 commits into from
Jan 21, 2021

Conversation

HeavyWombat
Copy link
Contributor

I went on the Go Report Card of shipwright-io/build by chance and saw some minor warnings there. So I decided to quickly fix all warnings that were easy to fix.

This includes:

  • fixing spelling
  • missing comments
  • ineffective variable assignments

@qu1queee
Copy link
Contributor

@HeavyWombat could we use this PR to actually make this validations as part of a new Makefile target, see #445 (comment) ? We might need multiple new make targets, e.g. one for using misspell and another one for using staticcheck

@HeavyWombat
Copy link
Contributor Author

@HeavyWombat could we use this PR to actually make this validations as part of a new Makefile target, see #445 (comment) ? We might need multiple new make targets, e.g. one for using misspell and another one for using staticcheck

Yes, good point. I was also wondering if we should add it either as Makefile targets or directly in Travis. Usually, I would prefer that as a sanity-check Makefile target, which is then used prior to a test run. Does that make sense?

@qu1queee
Copy link
Contributor

@HeavyWombat yes. I think in this way we enforce people to fix this sanity checks in advance, and in theory we will not have the need of doing standalone prs. We can work on this together, let me know.

@openshift-ci-robot openshift-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jan 20, 2021
@qu1queee qu1queee self-requested a review January 20, 2021 16:45
Copy link
Member

@SaschaSchwarze0 SaschaSchwarze0 left a comment

Choose a reason for hiding this comment

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

Looks good @HeavyWombat. May you update the developer's documentation to introduce the new sanity-check target? Maybe in the Testing guide ?

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 21, 2021
Add Makefile targets for:
- go vet
- golint
- ineffassign
- misspell
- staticcheck
Fix `golint` issues for missing comments of exported functions and constants.
Use suggested replacements for `misspell` findings.
Remove trailing whitespaces.

Add missing whitespaces between words.

Delete duplicate whitespaces.
Remove unused variables reported by `staticcheck`.
Simplify return code on build controller watch call by combining the `return`
statement with the watch call.

Add `if err != nil` check in build controller `add` function for the `Watch`
that checks primary resource builds.

Add log statement in e2e test code where the err was assigned, but not checked.

Add `Expect` in e2e test code where err was assigned, but not used.
Based on feedback in #538, harmonise function signatures to better match.
Introduce section to explain the new Makefile targets.
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 21, 2021
Copy link
Member

@SaschaSchwarze0 SaschaSchwarze0 left a comment

Choose a reason for hiding this comment

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

Nice work @HeavyWombat.

/lgtm
/approve

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 21, 2021
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: SaschaSchwarze0

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 21, 2021
@openshift-merge-robot openshift-merge-robot merged commit 05343e9 into shipwright-io:master Jan 21, 2021
@HeavyWombat HeavyWombat deleted the fix/go-card-warnings branch April 4, 2021 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants