feature/Add custom lint check for resource extensions#291
Draft
feature/Add custom lint check for resource extensions#291
Conversation
This commit introduces a new lint module and a custom lint check, `ResExtensionDetector`. The detector flags the following usages as errors: - Using raw integer literals with `.string` or `.painter` extensions (e.g., `1.string`). - Using resource IDs that are not from `R.string` or `R.drawable` with these extensions. The lint check is applied to the `app`, `designSystem`, and `presentation` modules. Additionally, this commit includes: - Gradle and library updates. - Minor refactoring in `SearchRemoteDataSourceImpl` and `RecentWatchedTvShowsDataSource` to use `@Provided` Koin annotation. - Update to `getCurrentDate()` to use `kotlin.time.Clock`. - Update target and compile SDK versions to 36. - Added new experimental opt-ins to compiler arguments.
Contributor
|
[London Bot] Metrics Update Status 📊 PR metrics successfully updated for event: |
Contributor
|
[London Bot] Auto-update Status ✅ Branch successfully updated from |
auto-merge was automatically disabled
July 27, 2025 01:18
Pull request was converted to draft
yusufnasserdev
approved these changes
Jul 28, 2025
Collaborator
yusufnasserdev
left a comment
There was a problem hiding this comment.
The linting addition is great, also the additional fixes are much appreciated, however, the version pumps starting from the gradle wrapper going through multiple libraries in the toml file might be unnecessary, considering many pumps at the same time.
Overall great job 🔥
mosayed01
reviewed
Jul 28, 2025
| "Only use constants from R.string or R.drawable with `.string` or `.painter`." | ||
| ) | ||
| } | ||
| } |
There was a problem hiding this comment.
Nice work!
What do you think about adding another detector to catch cases like painterResource(R.drawable.icon) and suggest a quick fix to use the extension style R.drawable.icon.painter instead?
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This commit introduces a new lint module and a custom lint check,
ResExtensionDetector.The detector flags the following usages as errors:
.stringor.painterextensions (e.g.,1.string).R.stringorR.drawablewith these extensions.The lint check is applied to the
app,designSystem, andpresentationmodules.Additionally, this commit includes:
SearchRemoteDataSourceImplandRecentWatchedTvShowsDataSourceto use@ProvidedKoin annotation.getCurrentDate()to usekotlin.time.Clock.