diff options
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/skylark/java/com/google/devtools/skylark/skylint/ControlFlowChecker.java | 1 | ||||
-rw-r--r-- | src/tools/skylark/javatests/com/google/devtools/skylark/skylint/ControlFlowCheckerTest.java | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/tools/skylark/java/com/google/devtools/skylark/skylint/ControlFlowChecker.java b/src/tools/skylark/java/com/google/devtools/skylark/skylint/ControlFlowChecker.java index b7f94e9516..db28c52f6d 100644 --- a/src/tools/skylark/java/com/google/devtools/skylark/skylint/ControlFlowChecker.java +++ b/src/tools/skylark/java/com/google/devtools/skylark/skylint/ControlFlowChecker.java @@ -166,6 +166,7 @@ public class ControlFlowChecker extends SyntaxTreeVisitor { "some but not all execution paths of '" + node.getIdentifier() + "' return a value." + + " If it is intentional, make it explicit using 'return None'." + " If you know these cannot happen," + " add the statement `fail('unreachable')` to them." + " For more details, have a look at the documentation.", diff --git a/src/tools/skylark/javatests/com/google/devtools/skylark/skylint/ControlFlowCheckerTest.java b/src/tools/skylark/javatests/com/google/devtools/skylark/skylint/ControlFlowCheckerTest.java index 16099a7184..6d7a673acc 100644 --- a/src/tools/skylark/javatests/com/google/devtools/skylark/skylint/ControlFlowCheckerTest.java +++ b/src/tools/skylark/javatests/com/google/devtools/skylark/skylint/ControlFlowCheckerTest.java @@ -53,6 +53,7 @@ public class ControlFlowCheckerTest { .toString()) .contains( "1:1-5:12: some but not all execution paths of 'some_function' return a value." + + " If it is intentional, make it explicit using 'return None'." + " If you know these cannot happen," + " add the statement `fail('unreachable')` to them." + " For more details, have a look at the documentation. [missing-return-value]"); @@ -71,6 +72,7 @@ public class ControlFlowCheckerTest { Truth.assertThat(messages) .contains( "1:1-5:10: some but not all execution paths of 'some_function' return a value." + + " If it is intentional, make it explicit using 'return None'." + " If you know these cannot happen," + " add the statement `fail('unreachable')` to them." + " For more details, have a look at the documentation. [missing-return-value]"); @@ -94,6 +96,7 @@ public class ControlFlowCheckerTest { .toString()) .contains( "1:1-7:16: some but not all execution paths of 'f' return a value." + + " If it is intentional, make it explicit using 'return None'." + " If you know these cannot happen," + " add the statement `fail('unreachable')` to them." + " For more details, have a look at the documentation. [missing-return-value]"); @@ -114,6 +117,7 @@ public class ControlFlowCheckerTest { .toString()) .contains( "1:1-8:12: some but not all execution paths of 'f' return a value." + + " If it is intentional, make it explicit using 'return None'." + " If you know these cannot happen," + " add the statement `fail('unreachable')` to them." + " For more details, have a look at the documentation. [missing-return-value]"); |