Skip to content

Latest commit

 

History

History
39 lines (22 loc) · 1.1 KB

codestyle-setup.md

File metadata and controls

39 lines (22 loc) · 1.1 KB

Codestyle Setup

Mapbox uses proper codestyle files to enforce the same codestyle throughout the codebase.

Configuring Ktlint setup

  1. On Mac OS or Linux: brew install ktlint
  2. Inside Project's root directory: ktlint --android applyToIDEAProject (current root directories is mapbox-navigation-android)

Gradle tasks

  • ./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

Configuring checkstyle.

For Mac

Go to Android Studio -> Preferences

Android Studio > Preferences

Click on Code Style

Preferences > Code Style

Click on Settings Icon -> Import Scheme -> Intellij IDEA code style XML

Import Scheme > IntelliJ IDEA code style XML

Select mapbox-java-codestyle.xml and click on Open

Select mapbox-java-codestyle.xml

Select the checkbox

Select checkbox

Click Ok