Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Add lint rule for AppCompatResources instead of ContextCompat #11397

Closed
sblatz opened this issue Jun 9, 2020 · 3 comments
Closed

Add lint rule for AppCompatResources instead of ContextCompat #11397

sblatz opened this issue Jun 9, 2020 · 3 comments
Assignees
Labels
🐞 bug Crashes, Something isn't working, .. eng:health Improve code health

Comments

@sblatz
Copy link
Contributor

sblatz commented Jun 9, 2020

This will prevent crashes like: #11395

┆Issue is synchronized with this Jira Task

@sblatz sblatz added 🐞 bug Crashes, Something isn't working, .. eng:health Improve code health labels Jun 9, 2020
@github-actions github-actions bot added the needs:triage Issue needs triage label Jun 9, 2020
@ekager ekager removed the needs:triage Issue needs triage label Jun 9, 2020
@data-sync-user data-sync-user changed the title Add lint rule for AppCompatResources instead of ContextCompat FNX3-14606 ⁃ Add lint rule for AppCompatResources instead of ContextCompat Aug 10, 2020
@data-sync-user data-sync-user changed the title FNX3-14606 ⁃ Add lint rule for AppCompatResources instead of ContextCompat FNX-12327 ⁃ Add lint rule for AppCompatResources instead of ContextCompat Aug 11, 2020
@data-sync-user data-sync-user changed the title FNX-12327 ⁃ Add lint rule for AppCompatResources instead of ContextCompat FNX2-13448 ⁃ Add lint rule for AppCompatResources instead of ContextCompat Aug 11, 2020
@kbrosnan kbrosnan changed the title FNX2-13448 ⁃ Add lint rule for AppCompatResources instead of ContextCompat Add lint rule for AppCompatResources instead of ContextCompat Aug 29, 2020
@juan-goncalves
Copy link
Contributor

Hey @sblatz I can do this

What should be the severity of the issue when detected? (Warning, Error)

I'm thinking on showing an error with a replace suggestion everytime a ContextCompat.getDawable or ContextCompat.getColorStateList call is detected, as they are the only methods available in the AppCompatResources class

@gabrielluong
Copy link
Member

gabrielluong commented Oct 18, 2020

Hey @sblatz I can do this

What should be the severity of the issue when detected? (Warning, Error)

I'm thinking on showing an error with a replace suggestion everytime a ContextCompat.getDawable or ContextCompat.getColorStateList call is detected, as they are the only methods available in the AppCompatResources class

@juan-goncalves Thank you for taking this on! I think your suggestion sounds good! @ekager any other suggestions?

@juan-goncalves
Copy link
Contributor

Great!
I'll open a PR shortly, I think its ready (let me know if you want anything changed)

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Crashes, Something isn't working, .. eng:health Improve code health
Projects
None yet
Development

No branches or pull requests

4 participants