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

Commit 32fe3c8a authored by Jeff Chen's avatar Jeff Chen
Browse files

Make linter message clearer.

Bug: 297100412
Test: unit test
Change-Id: I786fab416e8d8ed7cb589dbf0062ed6bd6d88300
parent 04079089
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -43,7 +43,9 @@ class DemotingTestWithoutBugDetector : Detector(), SourceCodeScanner {
                if (node.qualifiedName in DEMOTING_ANNOTATION_BUG_ID) {
                    if (!containsBugId(node)) {
                        val location = context.getLocation(node)
                        val message = "Please attach a bug id to track demoted test"
                        val message =
                            """Please attach a bug id to track demoted test, """ +
                                """e.g. @FlakyTest(bugId = 123)"""
                        context.report(ISSUE, node, location, message)
                    }
                }
@@ -51,7 +53,8 @@ class DemotingTestWithoutBugDetector : Detector(), SourceCodeScanner {
                if (node.qualifiedName == DEMOTING_ANNOTATION_IGNORE) {
                    if (!containsBugString(node)) {
                        val location = context.getLocation(node)
                        val message = "Please attach a bug (e.g. b/123) to track demoted test"
                        val message =
                            """Please attach a bug to track demoted test, e.g. @Ignore("b/123")"""
                        context.report(ISSUE, node, location, message)
                    }
                }
+5 −5
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ class DemotingTestWithoutBugDetectorTest : SystemUILintDetectorTest() {
            .run()
            .expect(
                """
                src/test/pkg/TestClass.java:4: Warning: Please attach a bug id to track demoted test [DemotingTestWithoutBug]
                src/test/pkg/TestClass.java:4: Warning: Please attach a bug id to track demoted test, e.g. @FlakyTest(bugId = 123) [DemotingTestWithoutBug]
                @FlakyTest
                ~~~~~~~~~~
                0 errors, 1 warnings
@@ -126,7 +126,7 @@ class DemotingTestWithoutBugDetectorTest : SystemUILintDetectorTest() {
            .run()
            .expect(
                """
                src/test/pkg/TestClass.java:4: Warning: Please attach a bug id to track demoted test [DemotingTestWithoutBug]
                src/test/pkg/TestClass.java:4: Warning: Please attach a bug id to track demoted test, e.g. @FlakyTest(bugId = 123) [DemotingTestWithoutBug]
                @FlakyTest
                ~~~~~~~~~~
                0 errors, 1 warnings
@@ -181,7 +181,7 @@ class DemotingTestWithoutBugDetectorTest : SystemUILintDetectorTest() {
            .run()
            .expect(
                """
                src/test/pkg/TestClass.java:4: Warning: Please attach a bug id to track demoted test [DemotingTestWithoutBug]
                src/test/pkg/TestClass.java:4: Warning: Please attach a bug id to track demoted test, e.g. @FlakyTest(bugId = 123) [DemotingTestWithoutBug]
                @Platinum(devices = "foo,bar")
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                0 errors, 1 warnings
@@ -236,7 +236,7 @@ class DemotingTestWithoutBugDetectorTest : SystemUILintDetectorTest() {
            .run()
            .expect(
                """
                src/test/pkg/TestClass.java:4: Warning: Please attach a bug (e.g. b/123) to track demoted test [DemotingTestWithoutBug]
                src/test/pkg/TestClass.java:4: Warning: Please attach a bug to track demoted test, e.g. @Ignore("b/123") [DemotingTestWithoutBug]
                @Ignore
                ~~~~~~~
                0 errors, 1 warnings
@@ -264,7 +264,7 @@ class DemotingTestWithoutBugDetectorTest : SystemUILintDetectorTest() {
            .run()
            .expect(
                """
                src/test/pkg/TestClass.java:4: Warning: Please attach a bug (e.g. b/123) to track demoted test [DemotingTestWithoutBug]
                src/test/pkg/TestClass.java:4: Warning: Please attach a bug to track demoted test, e.g. @Ignore("b/123") [DemotingTestWithoutBug]
                @Ignore("Not ready")
                ~~~~~~~~~~~~~~~~~~~~
                0 errors, 1 warnings