Code cleanup
MSALAutomatically clean up code, e.g. remove unnecessary parentheses, add missing braces and fix whitespace.
org. openrewrite. staticanalysis. CodeCleanupmod run . --recipe= org. openrewrite. staticanalysis. CodeCleanupInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.
Recipe list
It runs these recipes, in this order.
- Default comes last
- Remove empty blocks
- End files with a single newline
forloop counters should use postfix operators- Finalize private fields
- Method parameter padding
- No whitespace after
- No whitespace before
- Pad empty
forloop components - Typecast parenthesis padding
- Equals avoids null
- Explicit initialization
- Fall through
- Hide utility class constructor
- Fix missing braces
- Operator wrapping
- Remove unnecessary parentheses
- Replace calls to
Thread.run()withThread.start() - Chain
StringBuilder.append()calls - Remove methods that only call super
- Replace
StringBuilder#appendwithString - Add imports for fully qualified references to types
- Simplify single-element annotation
- Order imports
- Remove unused labels