diff --git a/.github/workflows/code_quality_analysis.yml b/.github/workflows/code_quality_analysis.yml index ee2d0a37..a072420a 100644 --- a/.github/workflows/code_quality_analysis.yml +++ b/.github/workflows/code_quality_analysis.yml @@ -29,7 +29,7 @@ jobs: cache-read-only: true - name: Initialize CodeQL - uses: github/codeql-action/init@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10 + uses: github/codeql-action/init@6db8d6351fd0be61f9ed8ebd12ccd35dcec51fea # v3.26.11 with: languages: java tools: latest @@ -41,7 +41,7 @@ jobs: ./gradlew assembleDebug assembleInternal - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10 + uses: github/codeql-action/analyze@6db8d6351fd0be61f9ed8ebd12ccd35dcec51fea # v3.26.11 with: category: "/language:java" mobsfscan: @@ -62,6 +62,6 @@ jobs: args: . --sarif --output results.sarif || true - name: Upload mobsfscan report - uses: github/codeql-action/upload-sarif@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10 + uses: github/codeql-action/upload-sarif@6db8d6351fd0be61f9ed8ebd12ccd35dcec51fea # v3.26.11 with: sarif_file: results.sarif diff --git a/android/lint-baseline.xml b/android/lint-baseline.xml index 89dd05ac..b138baa5 100644 --- a/android/lint-baseline.xml +++ b/android/lint-baseline.xml @@ -1,5 +1,5 @@ - + - + diff --git a/api/src/main/kotlin/dev/msfjarvis/claw/api/converters/CSRFTokenConverter.kt b/api/src/main/kotlin/dev/msfjarvis/claw/api/converters/CSRFTokenConverter.kt index 18bf8695..05c32b92 100644 --- a/api/src/main/kotlin/dev/msfjarvis/claw/api/converters/CSRFTokenConverter.kt +++ b/api/src/main/kotlin/dev/msfjarvis/claw/api/converters/CSRFTokenConverter.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2023 Harsh Shandilya. + * Copyright © 2023-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -19,8 +19,9 @@ object CSRFTokenConverter : Converter { val token = Jsoup.parse(value.string(), LobstersApi.BASE_URL) .select("meta[name=\"csrf-token\"]") - .first()!! - .attr("content") + .firstOrNull() + ?.attr("content") + .orEmpty() return CSRFToken(token) } diff --git a/api/src/test/kotlin/dev/msfjarvis/claw/util/TestUtils.kt b/api/src/test/kotlin/dev/msfjarvis/claw/util/TestUtils.kt index 00c5346b..6cad5c02 100644 --- a/api/src/test/kotlin/dev/msfjarvis/claw/util/TestUtils.kt +++ b/api/src/test/kotlin/dev/msfjarvis/claw/util/TestUtils.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2021-2023 Harsh Shandilya. + * Copyright © 2021-2024 Harsh Shandilya. * Use of this source code is governed by an MIT-style * license that can be found in the LICENSE file or at * https://opensource.org/licenses/MIT. @@ -15,7 +15,9 @@ import kotlin.contracts.contract object TestUtils { fun getResource(path: String): String { // Load the JSON response - val uri = javaClass.classLoader!!.getResource(path) + val uri = + requireNotNull(javaClass.classLoader) { "if this is null something has gone very wrong" } + .getResource(path) val file = File(uri.path) return String(file.readBytes()) } diff --git a/build-logic/lint-baseline.xml b/build-logic/lint-baseline.xml index 33e650d0..46f92457 100644 --- a/build-logic/lint-baseline.xml +++ b/build-logic/lint-baseline.xml @@ -1,4 +1,15 @@ - + + + + + diff --git a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/KotlinCommonPlugin.kt b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/KotlinCommonPlugin.kt index c615e3b3..7e886e3e 100644 --- a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/KotlinCommonPlugin.kt +++ b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/KotlinCommonPlugin.kt @@ -17,11 +17,11 @@ import org.gradle.kotlin.dsl.withType import org.jetbrains.kotlin.gradle.dsl.KotlinVersion import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -@Suppress("Unused") +@Suppress("Unused", "UnstableApiUsage") class KotlinCommonPlugin : Plugin { override fun apply(project: Project) { - if (project.rootProject == project) { + if (project.isolated.rootProject == project.isolated) { LintConfig.configureRootProject(project) } else if (project.name != "benchmark") { LintConfig.configureSubProject(project) diff --git a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/SpotlessPlugin.kt b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/SpotlessPlugin.kt index 004e5ba7..130abb2c 100644 --- a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/SpotlessPlugin.kt +++ b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/SpotlessPlugin.kt @@ -16,11 +16,11 @@ import org.gradle.kotlin.dsl.apply import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.withType -@Suppress("Unused") +@Suppress("Unused", "UnstableApiUsage") class SpotlessPlugin : Plugin { override fun apply(project: Project) { - if (project.rootProject != project) { + if (project.isolated.rootProject != project.isolated) { throw GradleException("Spotless plugin must only be applied to the root project.") } project.pluginManager.apply(SpotlessPlugin::class) diff --git a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/signing/AppSigning.kt b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/signing/AppSigning.kt index 15b0ed90..268ff702 100644 --- a/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/signing/AppSigning.kt +++ b/build-logic/src/main/kotlin/dev/msfjarvis/claw/gradle/signing/AppSigning.kt @@ -14,8 +14,9 @@ import org.gradle.api.Project private const val KEYSTORE_CONFIG_PATH = "keystore.properties" /** Configure signing for all build types. */ +@Suppress("UnstableApiUsage") internal fun Project.configureBuildSigning() { - val keystoreConfigFile = rootProject.layout.projectDirectory.file(KEYSTORE_CONFIG_PATH) + val keystoreConfigFile = isolated.rootProject.projectDirectory.file(KEYSTORE_CONFIG_PATH) if (keystoreConfigFile.asFile.exists()) { extensions.configure>("android") { val contents = providers.fileContents(keystoreConfigFile).asText @@ -25,7 +26,10 @@ internal fun Project.configureBuildSigning() { signingConfigs.register("release") { keyAlias = keystoreProperties["keyAlias"] as String keyPassword = keystoreProperties["keyPassword"] as String - storeFile = rootProject.file(keystoreProperties["storeFile"] as String) + storeFile = + isolated.rootProject.projectDirectory + .file(keystoreProperties["storeFile"] as String) + .asFile storePassword = keystoreProperties["storePassword"] as String } buildTypes.configureEach { signingConfig = releaseSigningConfig.get() } diff --git a/common/lint-baseline.xml b/common/lint-baseline.xml index f298ed1e..54da35fa 100644 --- a/common/lint-baseline.xml +++ b/common/lint-baseline.xml @@ -1,4 +1,4 @@ - + diff --git a/core/lint-baseline.xml b/core/lint-baseline.xml index f298ed1e..54da35fa 100644 --- a/core/lint-baseline.xml +++ b/core/lint-baseline.xml @@ -1,4 +1,4 @@ - + diff --git a/database/core/lint-baseline.xml b/database/core/lint-baseline.xml index f298ed1e..54da35fa 100644 --- a/database/core/lint-baseline.xml +++ b/database/core/lint-baseline.xml @@ -1,4 +1,4 @@ - + diff --git a/database/impl/lint-baseline.xml b/database/impl/lint-baseline.xml index f298ed1e..54da35fa 100644 --- a/database/impl/lint-baseline.xml +++ b/database/impl/lint-baseline.xml @@ -1,4 +1,4 @@ - + diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7c4a50e8..3b67186f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -102,7 +102,7 @@ retrofit-kotlinxSerializationConverter = { module = "com.squareup.retrofit2:conv sentry-android = { module = "io.sentry:sentry-android", version.ref = "sentry-sdk" } sentry-bom = { module = "io.sentry:sentry-bom", version.ref = "sentry-sdk" } slack-compose-lints = "com.slack.lint.compose:compose-lint-checks:1.4.1" -slack-lints = "com.slack.lint:slack-lint-checks:0.8.0" +slack-lints = "com.slack.lint:slack-lint-checks:0.8.1" sqldelight-androidDriver = { module = "app.cash.sqldelight:android-driver", version.ref = "sqldelight" } sqldelight-dialect338 = { module = "app.cash.sqldelight:sqlite-3-38-dialect", version.ref = "sqldelight" } sqldelight-extensions-coroutines = { module = "app.cash.sqldelight:coroutines-extensions-jvm", version.ref = "sqldelight" } @@ -121,7 +121,7 @@ android-junit5 = { id = "de.mannodermaus.android-junit5", version.ref = "android android-test = { id = "com.android.test", version.ref = "agp" } anvil = "com.squareup.anvil:2.5.0-beta11" baselineprofile = { id = "androidx.baselineprofile", version.ref = "benchmark" } -dependencyAnalysis = "com.autonomousapps.dependency-analysis:2.1.1" +dependencyAnalysis = "com.autonomousapps.dependency-analysis:2.1.3" invert = "com.squareup.invert:0.0.1-dev" kotlin-composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } diff --git a/model/lint-baseline.xml b/model/lint-baseline.xml index f298ed1e..54da35fa 100644 --- a/model/lint-baseline.xml +++ b/model/lint-baseline.xml @@ -1,4 +1,4 @@ - + diff --git a/store/lint-baseline.xml b/store/lint-baseline.xml index f298ed1e..54da35fa 100644 --- a/store/lint-baseline.xml +++ b/store/lint-baseline.xml @@ -1,4 +1,4 @@ - + diff --git a/web/lint-baseline.xml b/web/lint-baseline.xml index f298ed1e..54da35fa 100644 --- a/web/lint-baseline.xml +++ b/web/lint-baseline.xml @@ -1,4 +1,4 @@ - +