-
Notifications
You must be signed in to change notification settings - Fork 508
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
✨ [migration to score] 1: create errors and new functions #712
Conversation
pkg/scorecard.go
Outdated
@@ -22,14 +23,13 @@ import ( | |||
"time" | |||
|
|||
"github.com/google/go-github/v32/github" | |||
"github.com/shurcooL/githubv4" |
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.
Revert changes in this file
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 seems the dependency is not needed. I did not purposely remove it, but my editor figured it was not needed and removed it when I saved the file. No harm in removing it then?
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.
nice!
is this split out from #650. Do we still need to review that one? (Sorry for the delay)
// UPGRADEv2: New structure. Omitting unchanged Name field | ||
// for simplicity. | ||
Version int `json:"-"` // Default value of 0 indicates old structure. | ||
Error2 error `json:"-"` // Runtime error indicate a filure to run the check. |
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.
Do we need an Error2
, or can we just reuse the Error
field?
errors/internal.go
Outdated
|
||
//nolint | ||
var ( | ||
ErrInternalInvalidDockerFile = errors.New("invalid Dockerfile") |
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.
Since these are internal errors, these can simply be in checks
package and not be exported?
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.
good point. I initially put them all in errors/
so they are all in one place, but I think we can move those to checks/
unless we think they may be shared with other parts of the code, e.g. pkg/
.
Will move internal.go
to checks/errors.go
Please confirm that's OK.
I've addressed all comments. Merging. |
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
feature
What is the current behavior? (You can also link to an open issue here)
we use fail/pass
What is the new behavior (if this is a feature change)?
we define new function to move to score-based
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
no
Other information:
checker
--v2
CLI argument to enable us to check the new version, and a function to display the new result.