1. Use [spotless stylecheck](https://github.com/diffplug/spotless/tree/main/plugin-gradle). Spotless checkstyle plugin has the `spotlessApply` task which could automatically format code. 2. Use google code format.