Skip to content
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

Reduce false positives on comparing unrelated types #710

Merged
merged 1 commit into from
Nov 28, 2022

Conversation

Johnnei
Copy link
Contributor

@Johnnei Johnnei commented Nov 28, 2022

scala> BigDecimal(5) == 0
val res0: Boolean = false

scala> BigDecimal(0) == 0
val res1: Boolean = true

Scapegoat still seem to get the Literal instead of the boxed variants which I observed in bytecode after diagnosing a violation in my codebases. This special clause will handle these cases.

@codecov-commenter
Copy link

Codecov Report

Base: 87.11% // Head: 87.19% // Increases project coverage by +0.08% 🎉

Coverage data is based on head (970327b) compared to base (7407ec6).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #710      +/-   ##
==========================================
+ Coverage   87.11%   87.19%   +0.08%     
==========================================
  Files         141      141              
  Lines        1521     1523       +2     
  Branches      221      221              
==========================================
+ Hits         1325     1328       +3     
+ Misses        196      195       -1     
Impacted Files Coverage Δ
...inspections/equality/ComparingUnrelatedTypes.scala 96.00% <100.00%> (+4.69%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@saeltz saeltz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

@saeltz saeltz merged commit ad598e4 into scapegoat-scala:master Nov 28, 2022
@Johnnei Johnnei deleted the reduce-false-positives branch November 29, 2022 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants