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 ignoreWarnings = true
quiet = true quiet = true
disable += "LintError" disable += "LintError"
lintConfig = rootProject.file("lint.xml")
} }
androidComponents { androidComponents {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -30,11 +30,11 @@ private class PreviewNewtorkController : NetworkController {
mcc: String?, mcc: String?,
mnc: String? mnc: String?
): NetworkController.RegistrationNetworkResult<NetworkController.SessionMetadata, NetworkController.CreateSessionError> { ): NetworkController.RegistrationNetworkResult<NetworkController.SessionMetadata, NetworkController.CreateSessionError> {
TODO("Not yet implemented") throw NotImplementedError()
} }
override suspend fun getSession(sessionId: String): NetworkController.RegistrationNetworkResult<NetworkController.SessionMetadata, NetworkController.GetSessionStatusError> { override suspend fun getSession(sessionId: String): NetworkController.RegistrationNetworkResult<NetworkController.SessionMetadata, NetworkController.GetSessionStatusError> {
TODO("Not yet implemented") throw NotImplementedError()
} }
override suspend fun updateSession( override suspend fun updateSession(
@@ -42,7 +42,7 @@ private class PreviewNewtorkController : NetworkController {
pushChallengeToken: String?, pushChallengeToken: String?,
captchaToken: String? captchaToken: String?
): NetworkController.RegistrationNetworkResult<NetworkController.SessionMetadata, NetworkController.UpdateSessionError> { ): NetworkController.RegistrationNetworkResult<NetworkController.SessionMetadata, NetworkController.UpdateSessionError> {
TODO("Not yet implemented") throw NotImplementedError()
} }
override suspend fun requestVerificationCode( override suspend fun requestVerificationCode(
@@ -51,14 +51,14 @@ private class PreviewNewtorkController : NetworkController {
androidSmsRetrieverSupported: Boolean, androidSmsRetrieverSupported: Boolean,
transport: NetworkController.VerificationCodeTransport transport: NetworkController.VerificationCodeTransport
): NetworkController.RegistrationNetworkResult<NetworkController.SessionMetadata, NetworkController.RequestVerificationCodeError> { ): NetworkController.RegistrationNetworkResult<NetworkController.SessionMetadata, NetworkController.RequestVerificationCodeError> {
TODO("Not yet implemented") throw NotImplementedError()
} }
override suspend fun submitVerificationCode( override suspend fun submitVerificationCode(
sessionId: String, sessionId: String,
verificationCode: String verificationCode: String
): NetworkController.RegistrationNetworkResult<NetworkController.SessionMetadata, NetworkController.SubmitVerificationCodeError> { ): NetworkController.RegistrationNetworkResult<NetworkController.SessionMetadata, NetworkController.SubmitVerificationCodeError> {
TODO("Not yet implemented") throw NotImplementedError()
} }
override suspend fun registerAccount( override suspend fun registerAccount(
@@ -72,74 +72,74 @@ private class PreviewNewtorkController : NetworkController {
fcmToken: String?, fcmToken: String?,
skipDeviceTransfer: Boolean skipDeviceTransfer: Boolean
): NetworkController.RegistrationNetworkResult<NetworkController.RegisterAccountResponse, NetworkController.RegisterAccountError> { ): NetworkController.RegistrationNetworkResult<NetworkController.RegisterAccountResponse, NetworkController.RegisterAccountError> {
TODO("Not yet implemented") throw NotImplementedError()
} }
override suspend fun getFcmToken(): String? { override suspend fun getFcmToken(): String? {
TODO("Not yet implemented") throw NotImplementedError()
} }
override suspend fun awaitPushChallengeToken(): String? { override suspend fun awaitPushChallengeToken(): String? {
TODO("Not yet implemented") throw NotImplementedError()
} }
override fun getCaptchaUrl(): String { override fun getCaptchaUrl(): String {
TODO("Not yet implemented") throw NotImplementedError()
} }
override suspend fun restoreMasterKeyFromSvr( override suspend fun restoreMasterKeyFromSvr(
svr2Credentials: NetworkController.SvrCredentials, svr2Credentials: NetworkController.SvrCredentials,
pin: String pin: String
): NetworkController.RegistrationNetworkResult<NetworkController.MasterKeyResponse, NetworkController.RestoreMasterKeyError> { ): NetworkController.RegistrationNetworkResult<NetworkController.MasterKeyResponse, NetworkController.RestoreMasterKeyError> {
TODO("Not yet implemented") throw NotImplementedError()
} }
override suspend fun setPinAndMasterKeyOnSvr( override suspend fun setPinAndMasterKeyOnSvr(
pin: String, pin: String,
masterKey: MasterKey masterKey: MasterKey
): NetworkController.RegistrationNetworkResult<Unit, NetworkController.BackupMasterKeyError> { ): NetworkController.RegistrationNetworkResult<Unit, NetworkController.BackupMasterKeyError> {
TODO("Not yet implemented") throw NotImplementedError()
} }
override suspend fun enableRegistrationLock(): NetworkController.RegistrationNetworkResult<Unit, NetworkController.SetRegistrationLockError> { override suspend fun enableRegistrationLock(): NetworkController.RegistrationNetworkResult<Unit, NetworkController.SetRegistrationLockError> {
TODO("Not yet implemented") throw NotImplementedError()
} }
override suspend fun disableRegistrationLock(): NetworkController.RegistrationNetworkResult<Unit, NetworkController.SetRegistrationLockError> { 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> { 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> { override suspend fun setAccountAttributes(attributes: NetworkController.AccountAttributes): NetworkController.RegistrationNetworkResult<Unit, NetworkController.SetAccountAttributesError> {
TODO("Not yet implemented") throw NotImplementedError()
} }
} }
private class PreviewStorageController : StorageController { private class PreviewStorageController : StorageController {
override suspend fun generateAndStoreKeyMaterial(): KeyMaterial { override suspend fun generateAndStoreKeyMaterial(): KeyMaterial {
TODO("Not yet implemented") throw NotImplementedError()
} }
override suspend fun saveNewRegistrationData(newRegistrationData: NewRegistrationData) { override suspend fun saveNewRegistrationData(newRegistrationData: NewRegistrationData) {
TODO("Not yet implemented") throw NotImplementedError()
} }
override suspend fun getPreExistingRegistrationData(): PreExistingRegistrationData? { override suspend fun getPreExistingRegistrationData(): PreExistingRegistrationData? {
TODO("Not yet implemented") throw NotImplementedError()
} }
override suspend fun saveValidatedPinAndTemporaryMasterKey(pin: String, isAlphanumeric: Boolean, masterKey: MasterKey, registrationLockEnabled: Boolean) { 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) { override suspend fun saveNewlyCreatedPin(pin: String, isAlphanumeric: Boolean) {
TODO("Not yet implemented") throw NotImplementedError()
} }
override suspend fun clearAllData() { 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 { override fun compileStatement(sql: String): SupportSQLiteStatement {
TODO("Not yet implemented") throw NotImplementedError()
} }
override fun beginTransaction() { override fun beginTransaction() {
@@ -96,11 +96,11 @@ class SpinnerTestSqliteOpenHelper(context: Context) : SQLiteOpenHelper(context,
} }
override fun query(query: SupportSQLiteQuery): Cursor { override fun query(query: SupportSQLiteQuery): Cursor {
TODO("Not yet implemented") throw NotImplementedError()
} }
override fun query(query: SupportSQLiteQuery, cancellationSignal: CancellationSignal?): Cursor { override fun query(query: SupportSQLiteQuery, cancellationSignal: CancellationSignal?): Cursor {
TODO("Not yet implemented") throw NotImplementedError()
} }
override fun insert(table: String, conflictAlgorithm: Int, values: ContentValues): Long { override fun insert(table: String, conflictAlgorithm: Int, values: ContentValues): Long {

View File

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

View File

@@ -273,7 +273,8 @@ private fun EntryProviderScope<NavKey>.navigationEntries(
// -- Country Code Picker // -- Country Code Picker
entry<RegistrationRoute.CountryCodePicker> { entry<RegistrationRoute.CountryCodePicker> {
// We'll also want this to be some sort of launch-for-result flow as well // 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 // -- Captcha Screen

View File

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

View File

@@ -72,7 +72,8 @@ class PinCreationViewModel(
) )
} }
is PinCreationScreenEvents.LearnMore -> { 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) { when (result.error) {
is NetworkController.BackupMasterKeyError.EnclaveNotFound -> { is NetworkController.BackupMasterKeyError.EnclaveNotFound -> {
Log.w(TAG, "[PinSubmitted] SVR enclave not found.") 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 -> { is NetworkController.BackupMasterKeyError.NotRegistered -> {
Log.w(TAG, "[PinSubmitted] Account not registered. This should not happen. Resetting.") Log.w(TAG, "[PinSubmitted] Account not registered. This should not happen. Resetting.")
@@ -115,11 +117,13 @@ class PinCreationViewModel(
} }
is NetworkController.RegistrationNetworkResult.NetworkError -> { is NetworkController.RegistrationNetworkResult.NetworkError -> {
Log.w(TAG, "[PinSubmitted] Network error when backing up master key.", result.exception) 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 -> { is NetworkController.RegistrationNetworkResult.ApplicationError -> {
Log.w(TAG, "[PinSubmitted] Application error when backing up master key.", result.exception) 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) { when (registerResult.error) {
is NetworkController.RegisterAccountError.SessionNotFoundOrNotVerified -> { is NetworkController.RegisterAccountError.SessionNotFoundOrNotVerified -> {
Log.w(TAG, "[PinEntered] Session not found or verified: ${registerResult.error.message}") 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 -> { is NetworkController.RegisterAccountError.RegistrationLock -> {
Log.w(TAG, "[PinEntered] Still getting registration lock error after providing token. This shouldn't happen. Resetting state.") 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 -> { is NetworkController.RegisterAccountError.RegistrationRecoveryPasswordIncorrect -> {
Log.w(TAG, "[PinEntered] Registration recovery password incorrect: ${registerResult.error.message}") 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() { private fun handleSkip() {
Log.d(TAG, "Skip requested - this will result in account data loss after timeRemaining: $timeRemaining ms") 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( class Factory(

View File

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

View File

@@ -54,7 +54,7 @@ class VerificationCodeViewModel(
is VerificationCodeScreenEvents.WrongNumber -> state.also { parentEventEmitter.navigateTo(RegistrationRoute.PhoneNumberEntry) } is VerificationCodeScreenEvents.WrongNumber -> state.also { parentEventEmitter.navigateTo(RegistrationRoute.PhoneNumberEntry) }
is VerificationCodeScreenEvents.ResendSms -> transformResendCode(state, NetworkController.VerificationCodeTransport.SMS) is VerificationCodeScreenEvents.ResendSms -> transformResendCode(state, NetworkController.VerificationCodeTransport.SMS)
is VerificationCodeScreenEvents.CallMe -> transformResendCode(state, NetworkController.VerificationCodeTransport.VOICE) 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) is VerificationCodeScreenEvents.ConsumeInnerOneTimeEvent -> state.copy(oneTimeEvent = null)
} }
} }
@@ -148,7 +148,8 @@ class VerificationCodeViewModel(
is NetworkController.RegistrationNetworkResult.Failure -> { is NetworkController.RegistrationNetworkResult.Failure -> {
when (registerResult.error) { when (registerResult.error) {
is NetworkController.RegisterAccountError.SessionNotFoundOrNotVerified -> { 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 -> { is NetworkController.RegisterAccountError.DeviceTransferPossible -> {
Log.w(TAG, "[Register] Got told a device transfer is possible. We should never get into this state. Resetting.") 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) { override fun setPrefix(prefix: String) {
TODO("Not yet implemented") throw NotImplementedError()
} }
override fun setSuffix(suffix: String) { override fun setSuffix(suffix: String) {
TODO("Not yet implemented") throw NotImplementedError()
} }
override fun setCharset(charset: Charset?) { override fun setCharset(charset: Charset?) {
TODO("Not yet implemented") throw NotImplementedError()
} }
override fun getCharset(): Charset { override fun getCharset(): Charset {

View File

@@ -22,7 +22,9 @@
<issue id="CanvasSize" severity="error" /> <issue id="CanvasSize" severity="error" />
<issue id="HardcodedText" 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="ButtonOrder" severity="error" />
<issue id="ExtraTranslation" severity="warning" /> <issue id="ExtraTranslation" severity="warning" />
<issue id="UnspecifiedImmutableFlag" severity="error" /> <issue id="UnspecifiedImmutableFlag" severity="error" />