Mapbox uses proper codestyle files to enforce the same codestyle throughout the codebase.
Configuring Ktlint setup
- On Mac OS or Linux: brew install ktlint
- Inside Project's root directory: ktlint --android applyToIDEAProject (current root directories is mapbox-navigation-android)
- ./gradlew ktlint - run ktlint to check code-style
- ./gradlew ktlintFormat - run ktlint and try to fix code-style issues. Return non-0 if cannot fix all issues
For Mac
Go to Android Studio -> Preferences
Click on Code Style
Click on Settings Icon -> Import Scheme -> Intellij IDEA code style XML
Select mapbox-java-codestyle.xml
and click on Open
Select the checkbox
Click Ok