8000 code review by ccoVeille · Pull Request #132 · Boeing/config-file-validator · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 13 commits into from
Apr 11, 2024
Merged

code review #132

merged 13 commits into from
Apr 11, 2024

Conversation

ccoVeille
Copy link
Contributor

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.

  • chore: format files before working on them
  • fix: make sure to always wrap errors
  • fix: uncaught error in json reporter
  • fix: errors have to be manipulated with care
  • chore: fix some typos and error in the struct
  • chore: remove unused receivers

@ccoVeille
Copy link
Contributor Author
ccoVeille commented Mar 30, 2024

There is one more error in the code I would like to fix.

#134

It would require to refactor the code a bit, so I will wait to see if you are accepting this PR first 😄

@ccoVeille
Copy link
Contributor Author
ccoVeille commented Mar 30, 2024

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

@HakanVardarr
Copy link
Contributor

Sorry for that. :(

@kehoecj kehoecj added OSS Community Contribution Contributions from the OSS Community waiting-on-maintainer-review PR is waiting to be reviewed and functionally tested by the maintainers labels Apr 1, 2024
@kehoecj
Copy link
Collaborator
kehoecj commented Apr 1, 2024

Much appreciated @ccoVeille ❤️ Excited to take a look through the PR.

@ccoVeille
Copy link
Contributor Author

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.

@kehoecj kehoecj added pr-action-requested PR is awaiting feedback from the submitting developer and removed waiting-on-maintainer-review PR is waiting to be reviewed and functionally tested by the maintainers labels Apr 10, 2024
@kehoecj
Copy link
Collaborator
kehoecj commented Apr 10, 2024

@ccoVeille Once the merge conflicts are resolved I'll take a look at your PR next!

@ccoVeille
Copy link
Contributor Author

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.
@ccoVeille
Copy link
Contributor Author
ccoVeille commented Apr 10, 2024

I plan to add golangci-lint action to your repository with #137 to ensure code quality remains intact.

Copy link
Collaborator
@kehoecj kehoecj left a 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?

@ccoVeille
Copy link
Contributor Author

@kehoecj please merge

I will rebase and push back the linter

@kehoecj kehoecj merged commit 6d21ca3 into Boeing:main Apr 11, 2024
@ccoVeille ccoVeille deleted the code-review branch April 11, 2024 14:41
@ccoVeille
Copy link
Contributor Author

Also fixed #134

shiina4119 pushed a commit to shiina4119/config-file-validator that referenced this pull request Aug 23, 2024
* 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
shiina4119 pushed a commit to shiina4119/config-file-validator that referenced this pull request Oct 4, 2024
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OSS Community Contribution Contributions from the OSS Community pr-action-requested PR is awaiting feedback from the submitting developer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0