-
Notifications
You must be signed in to change notification settings - Fork 928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add lint to CI #1975
Add lint to CI #1975
Conversation
@@ -33,9 +33,6 @@ jobs: | |||
java-version: '11' | |||
distribution: 'adopt' | |||
|
|||
- name: Spotless |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleting this because it was already done as part of jvm_checks so we were actually wasting time here.
@@ -98,6 +98,7 @@ android { | |||
} | |||
} | |||
lintOptions { | |||
disable 'ObsoleteLintCustomCheck' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed otherwise lint fails because the internal lint registry in the fragments dependency.
@@ -127,6 +128,7 @@ class SpecialUrlDetectorImpl( | |||
return UrlType.Web(uriString) | |||
} | |||
|
|||
@SuppressLint("WrongConstant") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -177,6 +178,7 @@ class NotificationHandlerService : IntentService("NotificationHandlerService") { | |||
notificationManager.cancel(notificationId) | |||
} | |||
|
|||
@SuppressLint("MissingPermission") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -177,6 +178,7 @@ class VpnDiagnosticsActivity : DuckDuckGoActivity(), CoroutineScope by MainScope | |||
} | |||
} | |||
|
|||
@SuppressLint("RestrictedApi") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected, only used in internal but should trigger an error if used in release
@@ -187,7 +187,8 @@ class MigrationsProvider(val context: Context, val settingsDataStore: SettingsDa | |||
if (it.moveToFirst()) { | |||
var index = 0 | |||
do { | |||
val tabId = it.getString(it.getColumnIndex("tabId")) | |||
val colInd = it.getColumnIndex("tabId") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, Does this change break any warning / error from the lint checks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Funnily enough yes, there was an error saying getString needs an Int > 0. Still just moving that out makes no sense to me but 🤷
@@ -0,0 +1,125 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<issues format="6" by="lint 7.0.4" type="baseline" client="gradle" name="AGP (7.0.4)" variant="all" version="7.0.4"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't even know of these issues. Probably didn't notice them. 😅 So this is really helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, not sure about the overdrawn ones but the unused resources is probably because they are used on a different module?
@marcosholgado maybe stupid question, when I introduced a lint failure ./gradlew lint fails locally but assembling a build passes. Is this expected? Ci works as expected though (pass when no lint errors, fails when there are lint errors) |
mmm I guess it makes sense yeah |
Task/Issue URL: https://app.asana.com/0/414730916066338/1202273688878189/f
Description
This PR adds lint to CI and fixes a few errors/warnings. It also creates baselines for all the modules.
Steps to test this PR
Tests