Skip to content

NonBooleanPropertyPrefixedWithIs: Allow boolean functions - #5285

Merged
cortinico merged 2 commits into
detekt:mainfrom
brittanyberlanga:improve-NonBooleanPropertyPrefixedWithIs
Sep 8, 2022
Merged

NonBooleanPropertyPrefixedWithIs: Allow boolean functions#5285
cortinico merged 2 commits into
detekt:mainfrom
brittanyberlanga:improve-NonBooleanPropertyPrefixedWithIs

Conversation

@brittanyberlanga

Copy link
Copy Markdown
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.

@schalkms schalkms left a comment

Copy link
Copy Markdown
Member

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
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.

3 participants