aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/skylark/java
diff options
context:
space:
mode:
authorGravatar fzaiser <fzaiser@google.com>2017-10-24 16:58:03 +0200
committerGravatar Dmitry Lomov <dslomov@google.com>2017-10-24 17:25:58 +0200
commit88157011af4ddac21e404e9deea0d78668a71a99 (patch)
tree727df90d3c152d371696a2d82ec419f3cf9c7eb3 /src/tools/skylark/java
parentea2ecbf8c0601b5a1a72dfb849dc1b86a72df533 (diff)
Skylint: docstring format: warn about wrong order of sections only once
RELNOTES: none PiperOrigin-RevId: 173257316
Diffstat (limited to 'src/tools/skylark/java')
-rw-r--r--src/tools/skylark/java/com/google/devtools/skylark/skylint/DocstringUtils.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/tools/skylark/java/com/google/devtools/skylark/skylint/DocstringUtils.java b/src/tools/skylark/java/com/google/devtools/skylark/skylint/DocstringUtils.java
index 4d556543a6..1d37bc6389 100644
--- a/src/tools/skylark/java/com/google/devtools/skylark/skylint/DocstringUtils.java
+++ b/src/tools/skylark/java/com/google/devtools/skylark/skylint/DocstringUtils.java
@@ -328,6 +328,7 @@ public final class DocstringUtils {
List<ParameterDoc> params = new ArrayList<>();
String returns = "";
String deprecated = "";
+ boolean descriptionBodyAfterSpecialSectionsReported = false;
while (!eof()) {
switch (line) {
case "Args:":
@@ -352,8 +353,9 @@ public final class DocstringUtils {
deprecated = parseSectionAfterHeading();
break;
default:
- if (specialSectionsStarted) {
+ if (specialSectionsStarted && !descriptionBodyAfterSpecialSectionsReported) {
error("description body should go before the special sections");
+ descriptionBodyAfterSpecialSectionsReported = true;
}
if (deprecated.isEmpty() && nonStandardDeprecation.isEmpty()) {
nonStandardDeprecation = checkForNonStandardDeprecation(line);