is it intended to have to define a mixture of all ...
# detekt
z
is it intended to have to define a mixture of all of these to work? Only the deprecated one seems to work on if statements
a
OptionalWhenBraces
is deprecated in favour of
BracesOnWhen(When|If)Statements
comes with config options which you can customise as below
Copy code
BracesOnIfStatements:
  active: true
  singleLine: 'consistent'
  multiLine: 'consistent'
see https://detekt.dev/docs/rules/style/#bracesonifstatements
My config that I use
Copy code
BracesOnIfStatements:
  active: true
  singleLine: 'never'
  multiLine: 'always'
BracesOnWhenStatements:
  active: true
  singleLine: 'never'
  multiLine: 'always'
g
Also
OptionalWhenBraces
is going in 2.0: https://github.com/detekt/detekt/pull/6322 Should be marked as deprecated in 1.23.1