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

Goreportcard fixes #121

Merged
merged 2 commits into from
Apr 19, 2019
Merged

Goreportcard fixes #121

merged 2 commits into from
Apr 19, 2019

Conversation

vaskoz
Copy link
Contributor

@vaskoz vaskoz commented Jan 9, 2019

Some simple fixes identified by https://goreportcard.com/report/github.com/digitalocean/csi-digitalocean .

Everything but the gocyclo issues should be fixed by this PR.

@vaskoz
Copy link
Contributor Author

vaskoz commented Jan 11, 2019

Hi @fatih. When you have some free time, do you mind reviewing?

Copy link
Contributor

@nanzhong nanzhong left a comment

Choose a reason for hiding this comment

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

🚢

@vaskoz
Copy link
Contributor Author

vaskoz commented Jan 26, 2019

Thanks for the review @nanzhong. Do you have permissions to merge? If so, please do merge this PR.

@nanzhong
Copy link
Contributor

Nope 😢, I'll go get some and merge this. :)

Copy link
Contributor

@fatih fatih left a comment

Choose a reason for hiding this comment

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

Thanks @vaskoz

Can you please resolve one of the comments and squash all your changes in a single commit?

GB
// TB is a Tebibyte https://en.wikipedia.org/wiki/Tebibyte.
TB
Copy link
Contributor

Choose a reason for hiding this comment

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

These are not needed and makes it hard to read. Can you please remove these comments?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fatih I can definitely remove those comments, however, golint will still complain about those since they're exported. They appear in the GoReportCard as Line 37: warning: exported const KB should have comment (or a comment on this block) or be unexported (golint) and so on for the rest. https://goreportcard.com/report/github.com/digitalocean/csi-digitalocean#golint

The goal of this cosmetic PR is just to achieve 100% on all GoReportCard categories except gocyclo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All commits squashed into a single commit.

- gofmt -s -w simplifies some code
- add godoc to exported constants
- fix typo in DeleteSnapshot godoc
- golint: if block ends with a return statement, so drop this else and outdent its block
- add a space between comment block and godoc block
- in integration test return error if namespace cannot be created
- fix typo 'occured' to 'occurred'
GB
TB
_ = iota
kiB = 1 << (10 * iota)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

An alternative is to un-export these constants since they're not used outside of this package anyway. I added a commit to that effect.

If you prefer the exported constants without godoc, just let me know and I'll make that change.

@fatih fatih merged commit 28da67c into digitalocean:master Apr 19, 2019
@fatih
Copy link
Contributor

fatih commented Apr 19, 2019

Thanks @vaskoz for the contribution, much appreciated :)

jcodybaker pushed a commit that referenced this pull request Apr 25, 2019
jcodybaker pushed a commit that referenced this pull request Apr 26, 2019
jcodybaker added a commit that referenced this pull request Apr 26, 2019
* Cherry-pick: Add tagging support for Volumes via the new `--do-tag` flag
  [[GH-130]](#130)
* Cherry-pick: Fix support for volume snapshots by setting snapshot id on volume creation
  [[GH-129]](#129)
* Cherry-pick: Goreportcard fixes (typos, exported variables, etc..)
  [[GH-121]](#121)
* Cherry-pick: Rename the cluster role bindings for the `node-driver-registrar` to be
  consistent with the other role bindings.
  [[GH-118]](#118)
* Cherry-pick: Remove the `--token` flag for the `csi-do-node` driver. Drivers running on
  the node don't need the token anymore.
  [[GH-118]](#118)
* Cherry-pick: Don't check the volume limits on the worker nodes (worker nodes are not able
  to talk to DigitalOcean API)
  [[GH-142]](#142)
* Cherry-pick: Update `godo` (DigitalOcean API package) version to v1.13.0
  [[GH-143]](#143)
* Cherry-pick: Fix race in snapshot integration test.
  [[GH-146]](#146)
* Cherry-pick: Add tagging support for Volume snapshots via the new `--do-tag` flag
  [[GH-145]](#145)
jcodybaker added a commit that referenced this pull request Apr 26, 2019
* Cherry-pick: Add tagging support for Volumes via the new `--do-tag` flag
  [[GH-130]](#130)
* Cherry-pick: Fix support for volume snapshots by setting snapshot id on volume creation
  [[GH-129]](#129)
* Cherry-pick: Goreportcard fixes (typos, exported variables, etc..)
  [[GH-121]](#121)
* Cherry-pick: Rename the cluster role bindings for the `node-driver-registrar` to be
  consistent with the other role bindings.
  [[GH-118]](#118)
* Cherry-pick: Remove the `--token` flag for the `csi-do-node` driver. Drivers running on
  the node don't need the token anymore.
  [[GH-118]](#118)
* Cherry-pick: Don't check the volume limits on the worker nodes (worker nodes are not able
  to talk to DigitalOcean API)
  [[GH-142]](#142)
* Cherry-pick: Update `godo` (DigitalOcean API package) version to v1.13.0
  [[GH-143]](#143)
* Cherry-pick: Fix race in snapshot integration test.
  [[GH-146]](#146)
* Cherry-pick: Add tagging support for Volume snapshots via the new `--do-tag` flag
  [[GH-145]](#145)
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.

3 participants