Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 533f5466 authored by Kshitij Gupta's avatar Kshitij Gupta
Browse files

RunBlockingDetector: Mark runBlocking as error

- As a first step, we are enforcing use of runBlockingTraced
- We will soon deprecate the use of both: runBlocking & runBlockingTraced

Bug: 409734069
Test: RunBlockingDetectorTest
Flag: NONE - linter update
Change-Id: I21302b386084d80617c22e01eca72f0a3c8f251c
parent 14b95a23
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ class RunBlockingDetector : Detector(), SourceCodeScanner {
                    """,
                category = Category.PERFORMANCE,
                priority = 8,
                severity = Severity.WARNING,
                severity = Severity.ERROR,
                implementation =
                    Implementation(RunBlockingDetector::class.java, Scope.JAVA_FILE_SCOPE),
            )
+2 −2
Original line number Diff line number Diff line
@@ -52,10 +52,10 @@ class RunBlockingDetectorTest : SystemUILintDetectorTest() {
            .run()
            .expect(
                """
src/com/example/MyClass.kt:4: Warning: Importing kotlinx.coroutines.runBlocking is not allowed. [RunBlockingUsage]
src/com/example/MyClass.kt:4: Error: Importing kotlinx.coroutines.runBlocking is not allowed. [RunBlockingUsage]
                    import kotlinx.coroutines.runBlocking
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0 errors, 1 warnings
1 errors, 0 warnings
"""
                    .trimIndent()
            )