googlesamples / googlesamples/android-custom-lint-rules

Custom lint rules ignored for :library module

Open
#65 1 comment 7 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
1k
Forks
176
PR merge metrics
No merged PRs in 30d

Description

When I tried moving the Test.kt file from the :app module to the :library module, lint stopped reporting the expected warning.

Steps to reproduce:
1. `git clone https://github.com/googlesamples/android-custom-lint-rules.git`
2. `cd android-custom-lint-rules`
3. Move Test.kt to library module:
1. `mkdir -p library/src/main/java/com/example/lint/library`
2. `mv app/src/main/java/com/android/example/Test.kt library/src/main/java/com/example/lint/library`
3. `sed -i '' 's/com.android.example/com.example.lint.library/' library/src/main/java/com/example/lint/library/Test.kt`
4. Run either of these lint commands:
1. `./gradlew :library:lint`
2. `./gradlew lint`
5. Expected "Warning: This code mentions lint: Congratulations [SampleId]" but got none

This may be related to [Custom lint checks stopped running for multi-module Android project after upgrading to Android Gradle Plugin 4.2.2](https://stackoverflow.com/questions/70357066/custom-lint-checks-stopped-running-for-multi-module-android-project-after-upgrad)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.