diff options
| author | 2023-08-24 19:55:44 +0000 | |
|---|---|---|
| committer | 2023-08-24 19:55:44 +0000 | |
| commit | b31e95afe51d0eb22b4b544450066caab92a1f8f (patch) | |
| tree | 30d9e1431a6efc28056fc65d223bb0eae2c3533e | |
| parent | 1104d1a8e2c5b0026338af6520b96366f38044bd (diff) | |
| parent | 32fe3c8a3f47348adf19c8acdf74741823d697dd (diff) | |
Merge "Make linter message clearer." into udc-qpr-dev
2 files changed, 10 insertions, 7 deletions
diff --git a/packages/SystemUI/checks/src/com/android/internal/systemui/lint/DemotingTestWithoutBugDetector.kt b/packages/SystemUI/checks/src/com/android/internal/systemui/lint/DemotingTestWithoutBugDetector.kt index 09762b04e6a9..2fc56c97f124 100644 --- a/packages/SystemUI/checks/src/com/android/internal/systemui/lint/DemotingTestWithoutBugDetector.kt +++ b/packages/SystemUI/checks/src/com/android/internal/systemui/lint/DemotingTestWithoutBugDetector.kt @@ -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) } } diff --git a/packages/SystemUI/checks/tests/com/android/internal/systemui/lint/DemotingTestWithoutBugDetectorTest.kt b/packages/SystemUI/checks/tests/com/android/internal/systemui/lint/DemotingTestWithoutBugDetectorTest.kt index a1e6f92a7218..ee6e0ce72713 100644 --- a/packages/SystemUI/checks/tests/com/android/internal/systemui/lint/DemotingTestWithoutBugDetectorTest.kt +++ b/packages/SystemUI/checks/tests/com/android/internal/systemui/lint/DemotingTestWithoutBugDetectorTest.kt @@ -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 |