diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5fd32b2f89..0ee50b7070 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -81,6 +81,33 @@ jobs: name: Ktlint title: Ktlint Analyzer report path: '/tmp/ktlint/**/*.xml' + + - name: Run Detekt + run: ./gradlew detekt + + + - name: Stash Ktlint results + if: always() + run: | + rm -rf /tmp/detekt + mkdir /tmp/detekt + rsync -a --delete --ignore-errors examples/kmm-sample/androidApp/build/reports/detekt/ /tmp/detekt/example/ || true + rsync -a --delete --ignore-errors test/build/reports/detekt/ /tmp/detekt/test/ || true + rsync -a --delete --ignore-errors packages/cinterop/build/reports/detekt/ /tmp/detekt/cinterop/ || true + rsync -a --delete --ignore-errors packages/library-base/build/reports/detekt/ /tmp/detekt/library-base/ || true + rsync -a --delete --ignore-errors packages/library-sync/build/reports/detekt/ /tmp/detekt/library-sync/ || true + rsync -a --delete --ignore-errors packages/plugin-compiler/build/reports/detekt/ /tmp/detekt/plugin-compiler/ || true + rsync -a --delete --ignore-errors packages/gradle-plugin/build/reports/detekt/ /tmp/detekt/plugin-gradle/ || true + rsync -a --delete --ignore-errors benchmarks/build/reports/detekt/ /tmp/detekt/benchmarks/ || true + + - name: Publish Detekt results + uses: jwgmeligmeyling/checkstyle-github-action@master + if: always() + with: + name: Detekt + title: Detekt Analyzer report + path: '/tmp/detekt/**/*.xml' + # - name: Build packages # working-directory: packages diff --git a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/log/LogLevel.kt b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/log/LogLevel.kt index 3ae06580ca..2896da0996 100644 --- a/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/log/LogLevel.kt +++ b/packages/library-base/src/commonMain/kotlin/io/realm/kotlin/log/LogLevel.kt @@ -14,7 +14,7 @@ import io.realm.kotlin.log.LogLevel.WTF * * @see Configuration.SharedBuilder.log */ -@Suppress("MagicNumber") +// @Suppress("MagicNumber") public enum class LogLevel(public val priority: Int) { ALL(0), TRACE(1), diff --git a/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/Logger.kt b/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/Logger.kt index 6a975b626d..8c2d4205ae 100644 --- a/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/Logger.kt +++ b/packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/Logger.kt @@ -30,4 +30,4 @@ private fun logger(message: String, severity: CompilerMessageSeverity = Compiler fun logInfo(message: String) = logger(message, severity = CompilerMessageSeverity.INFO) fun logDebug(message: String) = logger(message, severity = CompilerMessageSeverity.LOGGING) fun logWarn(message: String, location: CompilerMessageSourceLocation? = null) = logger(message, severity = CompilerMessageSeverity.WARNING, location = location) -fun logError(message: String, location: CompilerMessageSourceLocation? = null) = logger(message, severity = CompilerMessageSeverity.ERROR, location = location) // /!\ This will log and fail the compilation /!\ \ No newline at end of file +fun logError(message: String, location: CompilerMessageSourceLocation? = null) = logger(message, severity = CompilerMessageSeverity.ERROR, location = location) // /!\ This will log and fail the compilation /!\