You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2020/02/07 22:18:25 UTC

[lucene-solr] branch master updated: LUCENE-9213: fix documentation-lint (and finally precommit) to work on java 12 and 13

This is an automated email from the ASF dual-hosted git repository.

rmuir pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/master by this push:
     new 69f26d0  LUCENE-9213: fix documentation-lint (and finally precommit) to work on java 12 and 13
69f26d0 is described below

commit 69f26d099ec36adec251cbf36594ea375d7fc620
Author: Robert Muir <rm...@apache.org>
AuthorDate: Fri Feb 7 17:15:11 2020 -0500

    LUCENE-9213: fix documentation-lint (and finally precommit) to work on java 12 and 13
    
    the "missing javadocs" checker needed tweaks to work with the format
    changes of java 13.
    
    As a followup we may investigate javadoc (maybe the new doclet api). It
    has its own missing checks too now, but they are black vs white (either
    fully documented or not checked), whereas this python tool allows us to
    "improve", e.g. enforce that all classes have doc, even if all
    methods do not yet.
---
 dev-tools/scripts/checkJavaDocs.py | 7 ++++---
 lucene/common-build.xml            | 8 +++++---
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/dev-tools/scripts/checkJavaDocs.py b/dev-tools/scripts/checkJavaDocs.py
index b43fcfb..14ded3d 100644
--- a/dev-tools/scripts/checkJavaDocs.py
+++ b/dev-tools/scripts/checkJavaDocs.py
@@ -22,7 +22,7 @@ reHREF = re.compile('<a.*?>(.*?)</a>', re.IGNORECASE)
 reMarkup = re.compile('<.*?>')
 reDivBlock = re.compile('<div class="block">(.*?)</div>', re.IGNORECASE)
 reCaption = re.compile('<caption><span>(.*?)</span>', re.IGNORECASE)
-reJ8Caption = re.compile('<h3>(.*?) Summary</h3>')
+reJ8Caption = re.compile('<h[23]>(.*?) Summary</h[23]>')
 reTDLastNested = re.compile('^<td class="colLast"><code><strong><a href="[^>]*\.([^>]*?)\.html" title="class in[^>]*">', re.IGNORECASE)
 reMethod = re.compile('^<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="[^>]*#([^>]*?)">', re.IGNORECASE)
 reColOne = re.compile('^<td class="colOne"><code><strong><a href="[^>]*#([^>]*?)">', re.IGNORECASE)
@@ -31,8 +31,9 @@ reNestedClassMemberNameLink = re.compile('^<td class="colLast"><code><span class
 reMemberNameOneLink = re.compile('^<td class="colOne"><code><span class="memberNameLink"><a href="[^>]*#([^>]*?)"', re.IGNORECASE)
 
 # the Method detail section at the end
-reMethodDetail = re.compile('^<h3>Method Detail</h3>$', re.IGNORECASE)
+reMethodDetail = re.compile('^<h[23]>Method Details?</h[23]>$', re.IGNORECASE)
 reMethodDetailAnchor = re.compile('^(?:</a>)?<a id="([^>]*?)">$', re.IGNORECASE)
+reJ13MethodDetailAnchor = re.compile('^(?:<h3>|</a>)<a id="([^>]*?)">[^>]*</a></h3>$', re.IGNORECASE)
 
 reTag = re.compile("(?i)<(\/?\w+)((\s+\w+(\s*=\s*(?:\".*?\"|'.*?'|[^'\">\s]+))?)+\s*|\s*)\/?>")
 
@@ -176,7 +177,7 @@ def checkClassSummaries(fullPath):
     # they should be specified elsewhere, if they are e.g. jdk or 
     # external classes we cannot inherit their docs anyway
     if foundMethodDetail:
-      m = reMethodDetailAnchor.search(line)
+      m = reMethodDetailAnchor.search(line) or reJ13MethodDetailAnchor.search(line)
       if m is not None:
         lastMethodAnchor = m.group(1)
         continue
diff --git a/lucene/common-build.xml b/lucene/common-build.xml
index e04b25d..6122a8a 100644
--- a/lucene/common-build.xml
+++ b/lucene/common-build.xml
@@ -332,9 +332,11 @@
         <contains string="${java.vm.name}" substring="openjdk" casesensitive="false"/>
         <contains string="${java.vm.name}" substring="jrockit" casesensitive="false"/>
       </or>
-      <equals arg1="${java.specification.version}" arg2="11"/>
-      <!-- TODO: Fix this! For now only run this on 64bit, because jTIDY OOMs with default heap size: -->
-      <!--<contains string="${os.arch}" substring="64"/>-->
+      <or>
+        <equals arg1="${java.specification.version}" arg2="11"/>
+        <equals arg1="${java.specification.version}" arg2="12"/>
+        <equals arg1="${java.specification.version}" arg2="13"/>
+      </or>
     </and>
   </condition>