Skip to content

Commit

Permalink
Support for detekt
Browse files Browse the repository at this point in the history
  • Loading branch information
cmelchior committed Jun 16, 2022
1 parent e2abeaa commit 9a35a8d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 /!\
fun logError(message: String, location: CompilerMessageSourceLocation? = null) = logger(message, severity = CompilerMessageSeverity.ERROR, location = location) // /!\ This will log and fail the compilation /!\

0 comments on commit 9a35a8d

Please sign in to comment.