Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1.5k
Add 'floatcompare' linter#2608
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Conversation
Hey, thank you for opening your first Pull Request ! |
CLAassistant commentedFeb 21, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
|
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.
Could you rebase your PR? Thanks.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
e89deb5 toe35cee4Compareldez commentedApr 5, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
In order for a pull request adding a linter to be reviewed, the linter and the PR must follow some requirements. Pull Request Description
Linter
The Linter Tests Inside Golangci-lint
|
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Thanks for the review, I think I have fixed most of the open points. In my view, there are three open points:
With the first two, I have no idea how I should be doing this, and it is written that you might help. The last one is recommended, this means it is optional? I will have a look how I could provide such a release with my linter. |
I added binaries to the release of the linter, and I believe I added a description about the linter to the pull request or do I have to add the description to the commit message? |
You don't have to squash:
So the commit message doesn't need to be updated. |
ldez commentedApr 8, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I have some problems with this linter. go-critic already tried to implementthis rule but the rule was removed and movedoutside go-critic. It's unclear why the rule has been pushed outside go-critic but I think it's because of the number offalse-positives. Otherwise, it is closed tohttps://go-critic.com/overview.html#truncatecmp |
This is interesting since the linter implements some mentioned problems in a laterpull request. Would it help if the linter was improved this way, or do you prefer not to have such a linter integrated?
On this point, I disagree since these two rules are very different since this checks for truncate problems whereas float comparison is a different problem as you might see in the description of thefloatcompare linter and the referencedlink. |
Uh oh!
There was an error while loading.Please reload this page.
https://github.com/mweb/floatcompare
Go linter to search for float comparison. Since floating-point numbers have some issues with rounding, a comparison of float might not return the expected result. Therefore, this linter helps to find possible bugs with floating point number comparison.