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

Replace require(x != null) with requireNotNull(x) #2998

Closed
3flex opened this issue Aug 21, 2020 · 2 comments · Fixed by #3003
Closed

Replace require(x != null) with requireNotNull(x) #2998

3flex opened this issue Aug 21, 2020 · 2 comments · Fixed by #3003
Labels
Milestone

Comments

@3flex
Copy link
Member

3flex commented Aug 21, 2020

Expected Behavior of the rule

When detekt comes across a require call that is just checking that a property is not null, suggest replacing with requireNotNull.

Context

#2336

And also:

@3flex 3flex added the rules label Aug 21, 2020
@maltaisn
Copy link

I believe this also applies to checkNotNull.

@schalkms
Copy link
Member

I think this rule belongs to the style ruleset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants