-
Notifications
You must be signed in to change notification settings - Fork 28
feat: add linting to actions ci #138
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
base: main
Are you sure you want to change the base?
Conversation
|
@hanshal101 Wanted to thank you quickly for this! Will need to take a bit of time to review which I don't have right now, but will try and get some good comments in tonight! One quick thing, its nice that it runs in CI, however it would be good to have an easy way to run it locally during development. Maybe via using |
Signed-off-by: hanshal101 <hanshalmehta10@gmail.com>
|
Hello @davidmdm I have made the necessary changes here! |
|
|
||
| json.NewEncoder(w).Encode(&review) | ||
| if err := json.NewEncoder(w).Encode(&review); err != nil { | ||
| log.Fatalf("error in encoding: %v", err) |
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.
Definitely cannot be fatal. Client connections to our server can dissappear, or there can be other reasons that we might fail to write to any give http.ResponseWriter.
We definitely do not want to crash the program.
I believe we already have a logger in scope
| )) | ||
| json.NewEncoder(w).Encode(review) | ||
| if err := json.NewEncoder(w).Encode(review); err != nil { | ||
| log.Fatalf("error in encoding: %v", err) |
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.
same as above
| func main() { | ||
| // This flight needs cross-namespace to be set in order to work and serves to test that feature. | ||
| json.NewEncoder(os.Stdout).Encode(flight.Resources{ | ||
| if err := json.NewEncoder(os.Stdout).Encode(flight.Resources{ |
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.
this is just testing. If it fails it will get caught in the tests.
Easier to just ignore the error explicitly:
_ = json.NewEncoder(...).Encode(...)
|
|
||
| func main() { | ||
| json.NewEncoder(os.Stdout).Encode(flight.Resources{ | ||
| if err := json.NewEncoder(os.Stdout).Encode(flight.Resources{ |
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.
same as above
Fixes #137
Closes #137
Description
This PR adds the linting flow in the Github Actions CI.
Also here I have fixed maximum lint errors. But few of them are left, I am a bit confused on how to fix them. Consider fixing before merge.