Ensure lint configuration is applied to all modules.

This commit is contained in:
Alex Hart
2026-02-09 13:05:28 -04:00
committed by Greyson Parrelli
parent 2c6524f6c0
commit 879e8f98bd
21 changed files with 73 additions and 51 deletions

View File

@@ -456,6 +456,7 @@ android {
ignoreWarnings = true
quiet = true
disable += "LintError"
lintConfig = rootProject.file("lint.xml")
}
androidComponents {

View File

@@ -37,6 +37,7 @@ android {
lint {
disable += "InvalidVectorPath"
lintConfig = rootProject.file("lint.xml")
}
}

View File

@@ -135,18 +135,17 @@ tasks.register("checkStopship") {
doLast {
val excludedFiles = listOf(
"build.gradle.kts",
"app/lint.xml"
"lint.xml"
)
val excludedDirectories = listOf(
"app/build",
"libsignal-service/build",
".idea"
)
val allowedExtensions = setOf("kt", "kts", "java", "xml")
val allFiles = cachedProjectDir.walkTopDown()
.onEnter { it.name != "build" || it.relativeTo(cachedProjectDir).path.contains("src") }
.asSequence()
.filter { it.isFile && it.extension in allowedExtensions }
.filterNot {

View File

@@ -21,7 +21,8 @@
android:layout_height="wrap_content"
android:text="Lookup"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"

View File

@@ -4,7 +4,8 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
tools:context=".MainActivity"
tools:ignore="HardcodedText" >
<Button
android:id="@+id/contact_list_button"

View File

@@ -8,7 +8,8 @@
android:clipChildren="false"
android:clipToPadding="false"
app:cardCornerRadius="5dp"
app:cardElevation="5dp">
app:cardElevation="5dp"
tools:ignore="HardcodedText">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"

View File

@@ -5,9 +5,11 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
tools:ignore="HardcodedText" >
<LinearLayout
android:id="@+id/buttonRow"

View File

@@ -4,7 +4,8 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
tools:context=".MainActivity"
tools:ignore="HardcodedText" >
<Button

View File

@@ -5,7 +5,8 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
tools:context=".MainActivity"
tools:ignore="HardcodedText" >
<HorizontalScrollView
android:id="@+id/buttons"

View File

@@ -5,7 +5,8 @@
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center_horizontal"
android:orientation="vertical">
android:orientation="vertical"
tools:ignore="HardcodedText" >
<Button
android:id="@+id/camera_switch"

View File

@@ -30,11 +30,11 @@ private class PreviewNewtorkController : NetworkController {
mcc: String?,
mnc: String?
): NetworkController.RegistrationNetworkResult<NetworkController.SessionMetadata, NetworkController.CreateSessionError> {
TODO("Not yet implemented")
throw NotImplementedError()
}
override suspend fun getSession(sessionId: String): NetworkController.RegistrationNetworkResult<NetworkController.SessionMetadata, NetworkController.GetSessionStatusError> {
TODO("Not yet implemented")
throw NotImplementedError()
}
override suspend fun updateSession(
@@ -42,7 +42,7 @@ private class PreviewNewtorkController : NetworkController {
pushChallengeToken: String?,
captchaToken: String?
): NetworkController.RegistrationNetworkResult<NetworkController.SessionMetadata, NetworkController.UpdateSessionError> {
TODO("Not yet implemented")
throw NotImplementedError()
}
override suspend fun requestVerificationCode(
@@ -51,14 +51,14 @@ private class PreviewNewtorkController : NetworkController {
androidSmsRetrieverSupported: Boolean,
transport: NetworkController.VerificationCodeTransport
): NetworkController.RegistrationNetworkResult<NetworkController.SessionMetadata, NetworkController.RequestVerificationCodeError> {
TODO("Not yet implemented")
throw NotImplementedError()
}
override suspend fun submitVerificationCode(
sessionId: String,
verificationCode: String
): NetworkController.RegistrationNetworkResult<NetworkController.SessionMetadata, NetworkController.SubmitVerificationCodeError> {
TODO("Not yet implemented")
throw NotImplementedError()
}
override suspend fun registerAccount(
@@ -72,74 +72,74 @@ private class PreviewNewtorkController : NetworkController {
fcmToken: String?,
skipDeviceTransfer: Boolean
): NetworkController.RegistrationNetworkResult<NetworkController.RegisterAccountResponse, NetworkController.RegisterAccountError> {
TODO("Not yet implemented")
throw NotImplementedError()
}
override suspend fun getFcmToken(): String? {
TODO("Not yet implemented")
throw NotImplementedError()
}
override suspend fun awaitPushChallengeToken(): String? {
TODO("Not yet implemented")
throw NotImplementedError()
}
override fun getCaptchaUrl(): String {
TODO("Not yet implemented")
throw NotImplementedError()
}
override suspend fun restoreMasterKeyFromSvr(
svr2Credentials: NetworkController.SvrCredentials,
pin: String
): NetworkController.RegistrationNetworkResult<NetworkController.MasterKeyResponse, NetworkController.RestoreMasterKeyError> {
TODO("Not yet implemented")
throw NotImplementedError()
}
override suspend fun setPinAndMasterKeyOnSvr(
pin: String,
masterKey: MasterKey
): NetworkController.RegistrationNetworkResult<Unit, NetworkController.BackupMasterKeyError> {
TODO("Not yet implemented")
throw NotImplementedError()
}
override suspend fun enableRegistrationLock(): NetworkController.RegistrationNetworkResult<Unit, NetworkController.SetRegistrationLockError> {
TODO("Not yet implemented")
throw NotImplementedError()
}
override suspend fun disableRegistrationLock(): NetworkController.RegistrationNetworkResult<Unit, NetworkController.SetRegistrationLockError> {
TODO("Not yet implemented")
throw NotImplementedError()
}
override suspend fun getSvrCredentials(): NetworkController.RegistrationNetworkResult<NetworkController.SvrCredentials, NetworkController.GetSvrCredentialsError> {
TODO("Not yet implemented")
throw NotImplementedError()
}
override suspend fun setAccountAttributes(attributes: NetworkController.AccountAttributes): NetworkController.RegistrationNetworkResult<Unit, NetworkController.SetAccountAttributesError> {
TODO("Not yet implemented")
throw NotImplementedError()
}
}
private class PreviewStorageController : StorageController {
override suspend fun generateAndStoreKeyMaterial(): KeyMaterial {
TODO("Not yet implemented")
throw NotImplementedError()
}
override suspend fun saveNewRegistrationData(newRegistrationData: NewRegistrationData) {
TODO("Not yet implemented")
throw NotImplementedError()
}
override suspend fun getPreExistingRegistrationData(): PreExistingRegistrationData? {
TODO("Not yet implemented")
throw NotImplementedError()
}
override suspend fun saveValidatedPinAndTemporaryMasterKey(pin: String, isAlphanumeric: Boolean, masterKey: MasterKey, registrationLockEnabled: Boolean) {
TODO("Not yet implemented")
throw NotImplementedError()
}
override suspend fun saveNewlyCreatedPin(pin: String, isAlphanumeric: Boolean) {
TODO("Not yet implemented")
throw NotImplementedError()
}
override suspend fun clearAllData() {
TODO("Not yet implemented")
throw NotImplementedError()
}
}

View File

@@ -43,7 +43,7 @@ class SpinnerTestSqliteOpenHelper(context: Context) : SQLiteOpenHelper(context,
}
override fun compileStatement(sql: String): SupportSQLiteStatement {
TODO("Not yet implemented")
throw NotImplementedError()
}
override fun beginTransaction() {
@@ -96,11 +96,11 @@ class SpinnerTestSqliteOpenHelper(context: Context) : SQLiteOpenHelper(context,
}
override fun query(query: SupportSQLiteQuery): Cursor {
TODO("Not yet implemented")
throw NotImplementedError()
}
override fun query(query: SupportSQLiteQuery, cancellationSignal: CancellationSignal?): Cursor {
TODO("Not yet implemented")
throw NotImplementedError()
}
override fun insert(table: String, conflictAlgorithm: Int, values: ContentValues): Long {

View File

@@ -7,7 +7,8 @@
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="8dp"
tools:context=".MainActivity">
tools:context=".MainActivity"
tools:ignore="HardcodedText">
<TextView
android:layout_width="match_parent"

View File

@@ -273,7 +273,8 @@ private fun EntryProviderScope<NavKey>.navigationEntries(
// -- Country Code Picker
entry<RegistrationRoute.CountryCodePicker> {
// We'll also want this to be some sort of launch-for-result flow as well
TODO()
// TODO [registration] - display country code picker
throw NotImplementedError("Country Code Picker not implemented")
}
// -- Captcha Screen

View File

@@ -388,7 +388,8 @@ class PhoneNumberEntryViewModel(
state
}
is NetworkController.RequestVerificationCodeError.MissingRequestInformationOrAlreadyVerified -> {
TODO()
// TODO [registration] - Error handling not implemented
throw NotImplementedError()
}
is NetworkController.RequestVerificationCodeError.SessionNotFound -> {
parentEventEmitter(RegistrationFlowEvent.ResetState)

View File

@@ -72,7 +72,8 @@ class PinCreationViewModel(
)
}
is PinCreationScreenEvents.LearnMore -> {
TODO("Show learn more dialog or navigate to help screen")
// TODO [registration] - Show learn more dialog or navigate to help screen
throw NotImplementedError("Show learn more dialog or navigate to help screen")
}
}
}
@@ -104,7 +105,8 @@ class PinCreationViewModel(
when (result.error) {
is NetworkController.BackupMasterKeyError.EnclaveNotFound -> {
Log.w(TAG, "[PinSubmitted] SVR enclave not found.")
TODO("Report to UI and indicate to library user that pin could not be created")
// TODO [registration] - Report to UI and indicate to library user that pin could not be created
throw NotImplementedError("Report to UI and indicate to library user that pin could not be created")
}
is NetworkController.BackupMasterKeyError.NotRegistered -> {
Log.w(TAG, "[PinSubmitted] Account not registered. This should not happen. Resetting.")
@@ -115,11 +117,13 @@ class PinCreationViewModel(
}
is NetworkController.RegistrationNetworkResult.NetworkError -> {
Log.w(TAG, "[PinSubmitted] Network error when backing up master key.", result.exception)
TODO("Report to UI and indicate to library user that pin could not be created")
// TODO [registration] - Report to UI and indicate to library user that pin could not be created
throw NotImplementedError("Report to UI and indicate to library user that pin could not be created")
}
is NetworkController.RegistrationNetworkResult.ApplicationError -> {
Log.w(TAG, "[PinSubmitted] Application error when backing up master key.", result.exception)
TODO("Report to UI and indicate to library user that pin could not be created")
// TODO [registration] - Report to UI and indicate to library user that pin could not be created
throw NotImplementedError("Report to UI and indicate to library user that pin could not be created")
}
}
}

View File

@@ -147,7 +147,8 @@ class PinEntryForRegistrationLockViewModel(
when (registerResult.error) {
is NetworkController.RegisterAccountError.SessionNotFoundOrNotVerified -> {
Log.w(TAG, "[PinEntered] Session not found or verified: ${registerResult.error.message}")
TODO()
// TODO [registration] - Handle session not found or verified.
throw NotImplementedError("Handle session not found or verified")
}
is NetworkController.RegisterAccountError.RegistrationLock -> {
Log.w(TAG, "[PinEntered] Still getting registration lock error after providing token. This shouldn't happen. Resetting state.")
@@ -168,7 +169,8 @@ class PinEntryForRegistrationLockViewModel(
}
is NetworkController.RegisterAccountError.RegistrationRecoveryPasswordIncorrect -> {
Log.w(TAG, "[PinEntered] Registration recovery password incorrect: ${registerResult.error.message}")
TODO()
// TODO [registration] - Handle incorrect password
throw NotImplementedError("Handle incorrect password")
}
}
}
@@ -185,7 +187,7 @@ class PinEntryForRegistrationLockViewModel(
private fun handleSkip() {
Log.d(TAG, "Skip requested - this will result in account data loss after timeRemaining: $timeRemaining ms")
// TODO: Show confirmation dialog warning about data loss, then proceed without PIN
// TODO [registration] - Show confirmation dialog warning about data loss, then proceed without PIN
}
class Factory(

View File

@@ -146,7 +146,8 @@ class PinEntryForSvrRestoreViewModel(
}
private fun handleSkip() {
TODO("Handle skip")
// TODO [registration] - Handle skip
throw NotImplementedError("Handle skip")
}
class Factory(

View File

@@ -54,7 +54,7 @@ class VerificationCodeViewModel(
is VerificationCodeScreenEvents.WrongNumber -> state.also { parentEventEmitter.navigateTo(RegistrationRoute.PhoneNumberEntry) }
is VerificationCodeScreenEvents.ResendSms -> transformResendCode(state, NetworkController.VerificationCodeTransport.SMS)
is VerificationCodeScreenEvents.CallMe -> transformResendCode(state, NetworkController.VerificationCodeTransport.VOICE)
is VerificationCodeScreenEvents.HavingTrouble -> TODO("having trouble flow")
is VerificationCodeScreenEvents.HavingTrouble -> throw NotImplementedError("having trouble flow") // TODO [registration] - Having trouble flow
is VerificationCodeScreenEvents.ConsumeInnerOneTimeEvent -> state.copy(oneTimeEvent = null)
}
}
@@ -148,7 +148,8 @@ class VerificationCodeViewModel(
is NetworkController.RegistrationNetworkResult.Failure -> {
when (registerResult.error) {
is NetworkController.RegisterAccountError.SessionNotFoundOrNotVerified -> {
TODO()
// TODO [registration] Handle session not found or not verified case.
throw NotImplementedError("Handle session not found or not verified case.")
}
is NetworkController.RegisterAccountError.DeviceTransferPossible -> {
Log.w(TAG, "[Register] Got told a device transfer is possible. We should never get into this state. Resetting.")

View File

@@ -30,15 +30,15 @@ class AssetTemplateLoader(private val context: Context) : TemplateLoader {
}
override fun setPrefix(prefix: String) {
TODO("Not yet implemented")
throw NotImplementedError()
}
override fun setSuffix(suffix: String) {
TODO("Not yet implemented")
throw NotImplementedError()
}
override fun setCharset(charset: Charset?) {
TODO("Not yet implemented")
throw NotImplementedError()
}
override fun getCharset(): Charset {

View File

@@ -22,7 +22,9 @@
<issue id="CanvasSize" severity="error" />
<issue id="HardcodedText" severity="error" />
<issue id="VectorRaster" severity="error" />
<issue id="VectorRaster" severity="error">
<ignore path="*/donate_with_googlepay_button_content.xml" /> <!-- Externally provided by Google -->
</issue>
<issue id="ButtonOrder" severity="error" />
<issue id="ExtraTranslation" severity="warning" />
<issue id="UnspecifiedImmutableFlag" severity="error" />