-
Notifications
You must be signed in to change notification settings - Fork 73
code review #132
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
code review #132
Conversation
There is one more error in the code I would like to fix. It would require to refactor the code a bit, so I will wait to see if you are accepting this PR first 😄 |
You are not fun @HakanVardarr 😄 you also started fixing in #131 issue I have fixed there 😝 As you started fixing them before me, I will wait for your PR to be merged then I will fix the conflicts |
Sorry for that. :( |
Much appreciated @ccoVeille ❤️ Excited to take a look through the PR. |
For record, you can review but I will wait for the #131 to be merged. I'm confident in being able to fix the conflicts easily. |
@ccoVeille Once the merge conflicts are resolved I'll take a look at your PR next! |
Here we go ! |
files were formatted with gofumpt
This is the only way to be able to catch a specific error with errors.Is in the code calling the method
The existing code could lead to errors with wrapped errors - using `if err == whatever` don't catch wrapped errors - using type assertion could lead to panic
The code is then clearer
any is available since Go 1.18, it makes code clearer.
an option of cli doesn't need to be named cli.CLIOption
when importing something from cli package, we shouldn't name a variable cli
The code is clearer to understand.
I plan to add |
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.
@ccoVeille LGTM - thanks for the code review! I learned some new things 😄 Do you want me to merge this now or wait for the linter?
@kehoecj please merge I will rebase and push back the linter |
Also fixed #134 |
* chore: format files before working on them files were formatted with gofumpt * fix: make sure to always wrap errors This is the only way to be able to catch a specific error with errors.Is in the code calling the method * fix: errors have to be manipulated with care The existing code could lead to errors with wrapped errors - using `if err == whatever` don't catch wrapped errors - using type assertion could lead to panic * fix: error returned by reporters must be handled * fix: misuage of WalkDirFunc * chore: fix some typos and error in the struct * chore: remove unused receivers The code is then clearer * chore: Replace all interface{} by any any is available since Go 1.18, it makes code clearer. * chore: use uppercase for JSON, XML, and YAML acronyms * chore: use simpler name for cli Option an option of cli doesn't need to be named cli.CLIOption * chore: avoid shadowing import when importing something from cli package, we shouldn't name a variable cli * chore: avoid useless else The code is clearer to understand. * chore: remove unused assertErrorIs and accept assert.Error
* chore: format files before working on them files were formatted with gofumpt * fix: make sure to always wrap errors This is the only way to be able to catch a specific error with errors.Is in the code calling the method * fix: errors have to be manipulated with care The existing code could lead to errors with wrapped errors - using `if err == whatever` don't catch wrapped errors - using type assertion could lead to panic * fix: error returned by reporters must be handled * fix: misuage of WalkDirFunc * chore: fix some typos and error in the struct * chore: remove unused receivers The code is then clearer * chore: Replace all interface{} by any any is available since Go 1.18, it makes code clearer. * chore: use uppercase for JSON, XML, and YAML acronyms * chore: use simpler name for cli Option an option of cli doesn't need to be named cli.CLIOption * chore: avoid shadowing import when importing something from cli package, we shouldn't name a variable cli * chore: avoid useless else The code is clearer to understand. * chore: remove unused assertErrorIs and accept assert.Error
I started looking at your code as I'm using it.
Some are existing errors, some are things that could become errors later with a refactoring
Here is a PR about fixing them.