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

FUNCTION_BOOLEAN_PREFIX on operator fun #1723

Closed
sanyavertolet opened this issue Aug 23, 2023 · 0 comments · Fixed by #1767
Closed

FUNCTION_BOOLEAN_PREFIX on operator fun #1723

sanyavertolet opened this issue Aug 23, 2023 · 0 comments · Fixed by #1767
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@sanyavertolet
Copy link
Member

sanyavertolet commented Aug 23, 2023

Diktat should not treat this code as an error

inline operator fun component3(): Boolean = asDynamic()[2].unsafeCast<Boolean>()

while this error message is shown:

[FUNCTION_BOOLEAN_PREFIX] functions that return the value of Boolean type should have <is> or <has> prefix: component3 (diktat-ruleset:identifier-naming)
@sanyavertolet sanyavertolet added the bug Something isn't working label Aug 23, 2023
@nulls nulls added the good first issue Good for newcomers label Sep 6, 2023
@0x6675636b796f75676974687562 0x6675636b796f75676974687562 changed the title FUNCTION_BOOLEAN_PREFIX on operator fun FUNCTION_BOOLEAN_PREFIX on operator fun Sep 6, 2023
@0x6675636b796f75676974687562 0x6675636b796f75676974687562 changed the title FUNCTION_BOOLEAN_PREFIX on operator fun FUNCTION_BOOLEAN_PREFIX on operator fun Sep 6, 2023
diphtongue added a commit that referenced this issue Oct 27, 2023
### What's done:
- fixed warning `FUNCTION_BOOLEAN_PREFIX` on `operator fun`.
- added warning test.

Closes #1723
diphtongue added a commit that referenced this issue Oct 31, 2023
diphtongue added a commit that referenced this issue Nov 1, 2023
* Fixed warning `FUNCTION_BOOLEAN_PREFIX` on `operator fun`

### What's done:
- fixed warning `FUNCTION_BOOLEAN_PREFIX` on `operator fun`.
- added `hasBooleanReturnType()` and `isOperatorFun()` function checks.
- added warning test.


* Closes #1723
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants