Code Formatting

Code Formatting

JADX enforces code style using two Gradle-integrated tools: Spotless (formatting) and Checkstyle (style rule checks). Both tools use config files that can be imported into IDEs.

Prerequisite: Gradle wrapper (./gradlew) must be available in the repository root.


Tools

Spotless

Apply formatting manually:

1./gradlew spotlessApply

Checkstyle


Running All Checks

Run formatting + style checks without executing tests:

1./gradlew spotlessApply
2./gradlew check -x test

Checks also run automatically during a full build:

1./gradlew build
1./gradlew spotlessApply        # Auto-fix formatting
2./gradlew check -x test        # Verify all style checks pass
3# Repeat until check -x test exits with no errors