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
Fixing megacheck issues reported by gometalinter #236
Conversation
Changes are all refactors and none to the existing logic. |
download/download.go
Outdated
@@ -83,7 +83,7 @@ func download(path, dest string, firstAttempt bool) (root *vcs.RepoRoot, err err | |||
if err != nil && firstAttempt { | |||
// may have been rebased; we delete the directory, then try one more time: | |||
log.Printf("Failed to update %q (%v), trying again...", root.Repo, err.Error()) | |||
err = os.RemoveAll(fullLocalPath) | |||
os.RemoveAll(fullLocalPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's log the err
here rather than remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Can do that
tools/scores/init_repo_scores.go
Outdated
@@ -11,8 +11,7 @@ import ( | |||
) | |||
|
|||
const ( | |||
repoBucket string = "repos" | |||
metaBucket string = "meta" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened to metaBucket
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an unused variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see now, thanks
@shawnps I've made the required changes as per your review comments. |
Hey @shawnps @hermanschaaf . Can this be merged? Also, I would like to discuss this issue #235. Considering the popularity of goreportcard, adding megacheck would have significant positive impact in my opinion. |
Following up on this. |
download/download.go
Outdated
@@ -84,6 +84,9 @@ func download(path, dest string, firstAttempt bool) (root *vcs.RepoRoot, err err | |||
// may have been rebased; we delete the directory, then try one more time: | |||
log.Printf("Failed to update %q (%v), trying again...", root.Repo, err.Error()) | |||
err = os.RemoveAll(fullLocalPath) | |||
if err != nil { | |||
log.Printf("Failed to delete directory : %s", fullLocalPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick but could you remove the space before the :
here?
log.Printf("Failed to delete directory: %s", fullLocalPath)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
LGTM |
Fixes the following issues reported :