Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 1.35 KB

README.md

File metadata and controls

37 lines (26 loc) · 1.35 KB

Android Coding Guidelines

Use .editorconfig

See .editorconfig for Android.

Use Android Lint

Android Lint is a static analysis tool that integrates with Android Studio and the Android Gradle Plugin. As such, it is generally more concerned with semantic issues than syntactic issues. It's recommended for CI builds. Faithlife's Android Lint ruleset specifies additional rules and is extendable to enforce house rules.

The app module should enable checkDependencies such that when lint is run against the app module, it also runs against each dependency module.

plugins {
    id("com.android.application")
}

android {
    defaultConfig {
        lint.checkDependencies = true
    }
}

Consider enabling treat warnings as errors on each gradle module in the project. Usually, you'll want to enable warnings as errors in each module individually so that if lint is explicitly run against a dependency module e.g. ./gradlew :data:lint, the lint error semantics will be consisitent.

android {
    defaultConfig {
        lint.warningsAsErrors = true
    }
}

Languages

Defer to the appropriate guide per language. Gradle plugins like Spotless can coordinate several formatting tools and apply them appropriately throughout the codebase.