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

Add noUniversalEquality option to DisableSyntax #877

Merged
merged 4 commits into from
Sep 21, 2018

Conversation

gabro
Copy link
Collaborator

@gabro gabro commented Sep 20, 2018

Closes #874

I hacked this together in 10 minutes, so I may be missing some edge cases.

I've explicitly restricted the rule to infix applications of == as I don't think handling non-infix applications (e.g., 1.==(2)) is worth the (albeit low) effort.

@gabro gabro requested a review from olafurpg September 20, 2018 17:03
Copy link
Contributor

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

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

This looks great! Thanks @gabro Left one question

@gabro gabro requested a review from olafurpg September 21, 2018 08:46
Copy link
Contributor

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Thank you @gabro ! I will follow up with a PR to make sure the new setting doesn't appear on the website until the next release, not sure yet how to implement that.

"Reporter message for noUniversalEquality"
)
noUniversalEqualityMessage: String =
"Universal equality should be avoided since it's not typesafe",
Copy link
Contributor

Choose a reason for hiding this comment

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

We may want to refine this message down the road, but it's not blocking

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm open to suggestions :)

Copy link
Contributor

Choose a reason for hiding this comment

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

== is unsafe since it allows comparing two unrelated types

@olafurpg olafurpg merged commit 5f3d0f0 into scalacenter:master Sep 21, 2018
@gabro gabro deleted the disable-syntax-no-eqeq branch September 21, 2018 12:46
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.

Let's add DisableSyntax.noUniversalEquality
2 participants