Skip to content

Add braces to single-line if/else (NeedBraces, 335 violations) #89

Description

@sspaink

NeedBraces flags if (cond) doThing(); patterns. 335 instances across ~80 files.

Top offenders

  • opa-evaluator/.../mapper/ClassInfo.java — 10
  • opa-evaluator/.../ir/stmts/{ObjectInsertStmt,WithStmt,ScanStmt}.java — 8 each
  • opa-evaluator/.../mapper/RegoMapper.java — 8
  • ~75 other files with 1–7 each

Fix

Mechanical. IDE auto-fix ("Add braces around statement") handles all of them. Safe to do in one PR or split per package.

Reproducing

```
./gradlew checkstyleMain checkstyleTest --continue
grep -r "NeedBraces" /build/reports/checkstyle/.xml
```

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions