Skip to content

Remove PMD rule SimplifyBooleanReturns#481

Merged
kaikreuzer merged 1 commit intoopenhab:mainfrom
holgerfriedrich:pr-remove-simplify-returns
Jan 26, 2025
Merged

Remove PMD rule SimplifyBooleanReturns#481
kaikreuzer merged 1 commit intoopenhab:mainfrom
holgerfriedrich:pr-remove-simplify-returns

Conversation

@holgerfriedrich
Copy link
Member

Remove SimplifyBooleanReturns from default rule set.
Readability of code tends to be better if this rule is not enforced.

It can be re-activated on project basis by using a custom ruleset, see configuration parameter pmdRuleset and supply an adapted rule set similar to rules.xml from this repo.

This is basically my conclusion from openhab/openhab-core#4555 and #4567.
See the code changes proposed in #4555 to get an impression of the readability of code compliant to this rule.

Remove from default rule set.
Readability of code tends to be better if this rule is not enforced.

It can be re-activated on project basis by using a custom ruleset,
see configuration parameter pmdRuleset and supply an adapted rule
set similar to rules.xml from this repo.

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
@holgerfriedrich holgerfriedrich requested a review from a team as a code owner January 19, 2025 15:14
Copy link
Member

@kaikreuzer kaikreuzer left a comment

Choose a reason for hiding this comment

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

I agree, enforcing this rule decreases readability.

@kaikreuzer kaikreuzer merged commit a14277b into openhab:main Jan 26, 2025
2 checks passed
@kaikreuzer kaikreuzer added this to the 0.18.0 milestone Jan 26, 2025
@holgerfriedrich holgerfriedrich deleted the pr-remove-simplify-returns branch January 26, 2025 13:58
@holgerfriedrich holgerfriedrich mentioned this pull request Nov 27, 2025
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.

2 participants