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

Commit b31e95af authored by Jeff Chen's avatar Jeff Chen Committed by Android (Google) Code Review
Browse files

Merge "Make linter message clearer." into udc-qpr-dev

parents 1104d1a8 32fe3c8a
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