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

NonBooleanPropertyPrefixedWithIs: Allow boolean functions #5285

Conversation

brittanyberlanga
Copy link
Contributor

This change builds on top of #4684 which allowed functions with a boolean return type to comply with the NonBooleanPropertyPrefixedWithIs rule. That change only allowed functions with zero parameters. With this change, I’m proposing that we open up the exception to any function with a boolean return type.

For example, something like the following would be considered compliant.

interface Business {
    val isOpenAt: (DateTime) -> Boolean
}

Let me know if there are any reservations around this change. My team found that it was odd that there was this limitation and I thought I’d check out if you all agree as well.

Copy link
Member

@schalkms schalkms left a comment

Choose a reason for hiding this comment

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

Thank you for this awesome contribution! 🙂

@cortinico cortinico added this to the 1.22.0 milestone Sep 8, 2022
@cortinico cortinico merged commit f104e99 into detekt:main Sep 8, 2022
21 checks passed
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 this pull request may close these issues.

None yet

3 participants