-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add 'floatcompare' linter #2608
base: master
Are you sure you want to change the base?
Conversation
Hey, thank you for opening your first Pull Request ! |
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.
e89deb5
to
e35cee4
Compare
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
|
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. |
I have some problems with this linter. go-critic already tried to implement this rule but the rule was removed and moved outside go-critic. It's unclear why the rule has been pushed outside go-critic but I think it's because of the number of false-positives. Otherwise, it is closed to https://go-critic.com/overview.html#truncatecmp |
This is interesting since the linter implements some mentioned problems in a later pull 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 the floatcompare linter and the referenced link. |
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.