You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/02/20 17:04:24 UTC

[GitHub] [lucene-solr] mocobeta opened a new pull request #1267: LUCENE-9201: Add missing javadocs check task

mocobeta opened a new pull request #1267: LUCENE-9201: Add missing javadocs check task
URL: https://github.com/apache/lucene-solr/pull/1267
 
 
   # Description
   
   This PR adds missing Javadocs check to gradle build (i.e., an equivalent to Ant build's "check-missing-javadocs" macro).
   
   # Note
   
   Newly added "checkMissingDocs" task will fail for now because there are missing package summaries.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1267: LUCENE-9201: Add missing javadocs check task

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1267: LUCENE-9201: Add missing javadocs check task
URL: https://github.com/apache/lucene-solr/pull/1267#discussion_r382174006
 
 

 ##########
 File path: gradle/validation/missing-docs-check.gradle
 ##########
 @@ -0,0 +1,124 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+allprojects {
+  task checkMissingDocs() {
+    group 'Verification'
+    description 'Check missing Javadocs'
+
+    dependsOn project.tasks.matching { task ->
+      task.name in [ 'checkMissingDocsPackage', 'checkMissingDocsClass', 'checkMissingDocsMethod' ]
+    }
+  }
+}
+
+configure(project(':lucene').subprojects) {
+
+  def methodLevelCheckProjects = [
+    project(':lucene:analysis:icu'),
+    project(':lucene:analysis:morfologik'),
+    project(':lucene:analysis:phonetic'),
+    project(':lucene:analysis:stempel'),
+    project(':lucene:classification'),
+    project(':lucene:demo'),
+    project(':lucene:expressions'),
+    project(':lucene:facet'),
+    project(':lucene:join'),
+    project(':lucene:memory'),
+    project(':lucene:suggest'),
+    project(':lucene:spatial3d')
+  ]
+
+  plugins.withType(JavaPlugin) {
+    if (project in methodLevelCheckProjects) {
+      // too many classes to fix overall to just enable the above to be level="method" right now,
+      // but we can prevent the modules that don't have problems from getting any worse
+      task checkMissingDocsMethod(type: CheckMissingDocsTask, dependsOn: 'javadoc') {
+        enabled = project.javadoc.destinationDir.exists()
+
+        dirs += [ project.javadoc.destinationDir.absolutePath ]
+        level = "method"
 
 Review comment:
   You can invert the logic here: create checkMissingDocsMethod once and only conditionally set level inside (depending on project.path

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1267: LUCENE-9201: Add missing javadocs check task

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1267: LUCENE-9201: Add missing javadocs check task
URL: https://github.com/apache/lucene-solr/pull/1267#discussion_r382988576
 
 

 ##########
 File path: gradle/validation/missing-docs-check.gradle
 ##########
 @@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+configure(rootProject) {
+  ext {
+    // too many classes to fix overall to just enable the above to be level="method" right now,
+    // but we can prevent the modules that don't have problems from getting any worse
+    methodLevels = [
+      ':lucene:analysis:icu',
+      ':lucene:analysis:morfologik',
+      ':lucene:analysis:phonetic',
+      ':lucene:analysis:stempel',
+      ':lucene:classification',
+      ':lucene:demo',
+      ':lucene:expressions',
+      ':lucene:facet',
+      ':lucene:join',
+      ':lucene:memory',
+      ':lucene:suggest',
+      ':lucene:spatial3d',
+    ]
+  }
+}
+
+allprojects {
+  plugins.withType(JavaPlugin) {
+
+    // set the default check level for each project
+    def lv = {
+      if (project.path.startsWith(':solr')) 'package'  // todo: add missing docs for all classes and bump this to level=class
+      else if (project.path in rootProject.methodLevels ) 'method'
+      else 'class'
+    }
+
+    task checkMissingDocsDefault(type: CheckMissingDocsTask, dependsOn: 'javadoc') {
+      enabled = project.javadoc.destinationDir.exists()
+      dirs += [ project.javadoc.destinationDir.absolutePath ]
+      level = lv.call()
+    }
+
+    task checkMissingDocs() {
+      group 'Verification'
+      description 'Check missing Javadocs'
+
+      dependsOn checkMissingDocsDefault
+    }
+
+  }
+}
+
+configure(project(':lucene:core')) {
+  plugins.withType(JavaPlugin) {
+
+    // too much to fix core/ for now, but enforce full javadocs for key packages
+    def checkedDirs = [
+      "/org/apache/lucene/util/automaton",
+      "/org/apache/lucene/analysis",
+      "/org/apache/lucene/document",
+      "/org/apache/lucene/search/similarities",
+      "/org/apache/lucene/index",
+      "/org/apache/lucene/codecs"
+    ].collect { path -> "${project.javadoc.destinationDir.absolutePath}${path}" }
+
+    task checkMissingDocsMethod(type: CheckMissingDocsTask, dependsOn: 'javadoc') {
+      dirs = checkedDirs
+      level = 'method'
+    }
+
+    checkMissingDocs {
+      dependsOn checkMissingDocsDefault
 
 Review comment:
   this dependency is already defined. Multiple dependsOn are stacked, not replaced.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1267: LUCENE-9201: Add missing javadocs check task

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1267: LUCENE-9201: Add missing javadocs check task
URL: https://github.com/apache/lucene-solr/pull/1267#discussion_r382988638
 
 

 ##########
 File path: gradle/validation/missing-docs-check.gradle
 ##########
 @@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+configure(rootProject) {
+  ext {
+    // too many classes to fix overall to just enable the above to be level="method" right now,
+    // but we can prevent the modules that don't have problems from getting any worse
+    methodLevels = [
+      ':lucene:analysis:icu',
+      ':lucene:analysis:morfologik',
+      ':lucene:analysis:phonetic',
+      ':lucene:analysis:stempel',
+      ':lucene:classification',
+      ':lucene:demo',
+      ':lucene:expressions',
+      ':lucene:facet',
+      ':lucene:join',
+      ':lucene:memory',
+      ':lucene:suggest',
+      ':lucene:spatial3d',
+    ]
+  }
+}
+
+allprojects {
+  plugins.withType(JavaPlugin) {
+
+    // set the default check level for each project
+    def lv = {
+      if (project.path.startsWith(':solr')) 'package'  // todo: add missing docs for all classes and bump this to level=class
+      else if (project.path in rootProject.methodLevels ) 'method'
+      else 'class'
+    }
+
+    task checkMissingDocsDefault(type: CheckMissingDocsTask, dependsOn: 'javadoc') {
+      enabled = project.javadoc.destinationDir.exists()
+      dirs += [ project.javadoc.destinationDir.absolutePath ]
+      level = lv.call()
+    }
+
+    task checkMissingDocs() {
+      group 'Verification'
+      description 'Check missing Javadocs'
+
+      dependsOn checkMissingDocsDefault
+    }
+
+  }
+}
+
+configure(project(':lucene:core')) {
+  plugins.withType(JavaPlugin) {
+
+    // too much to fix core/ for now, but enforce full javadocs for key packages
+    def checkedDirs = [
+      "/org/apache/lucene/util/automaton",
+      "/org/apache/lucene/analysis",
+      "/org/apache/lucene/document",
+      "/org/apache/lucene/search/similarities",
+      "/org/apache/lucene/index",
+      "/org/apache/lucene/codecs"
+    ].collect { path -> "${project.javadoc.destinationDir.absolutePath}${path}" }
+
+    task checkMissingDocsMethod(type: CheckMissingDocsTask, dependsOn: 'javadoc') {
+      dirs = checkedDirs
+      level = 'method'
+    }
+
+    checkMissingDocs {
+      dependsOn checkMissingDocsDefault
+      dependsOn checkMissingDocsMethod
+    }
+
+  }
+}
+
+class CheckMissingDocsTask extends DefaultTask {
+
+  @Input
+  List<String> dirs = []
+
+  @Input
+  String level = "none"
+
+  def checkMissingJavadocs(String dir, String level) {
+    project.exec {
 
 Review comment:
   I buffered the output of python execution and rethrow it as a gradle exception. this way the output is displayed at the end of execution in a summary (instead of when it was executed during concurrent build).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] mocobeta commented on issue #1267: LUCENE-9201: Add missing javadocs check task

Posted by GitBox <gi...@apache.org>.
mocobeta commented on issue #1267: LUCENE-9201: Add missing javadocs check task
URL: https://github.com/apache/lucene-solr/pull/1267#issuecomment-589722060
 
 
   Hi @dweiss I updated the task definitions.
   I defined one default task and the entry task for all projects, then tweaked the ":lucene:core" project to perform additional checks. What do you think about it, can we simplify the code more?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1267: LUCENE-9201: Add missing javadocs check task

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1267: LUCENE-9201: Add missing javadocs check task
URL: https://github.com/apache/lucene-solr/pull/1267#discussion_r382173652
 
 

 ##########
 File path: gradle/validation/missing-docs-check.gradle
 ##########
 @@ -0,0 +1,124 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+allprojects {
+  task checkMissingDocs() {
+    group 'Verification'
+    description 'Check missing Javadocs'
+
+    dependsOn project.tasks.matching { task ->
+      task.name in [ 'checkMissingDocsPackage', 'checkMissingDocsClass', 'checkMissingDocsMethod' ]
 
 Review comment:
   if you configure in a single closure this can be simplified to actual task references I think (not by name).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1267: LUCENE-9201: Add missing javadocs check task

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1267: LUCENE-9201: Add missing javadocs check task
URL: https://github.com/apache/lucene-solr/pull/1267#discussion_r382173351
 
 

 ##########
 File path: gradle/validation/missing-docs-check.gradle
 ##########
 @@ -0,0 +1,124 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+allprojects {
 
 Review comment:
   Add checkMissingDocs to projects with plugins.withType(JavaPlugin); single closure is then needed to configure all tasks.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1267: LUCENE-9201: Add missing javadocs check task

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1267: LUCENE-9201: Add missing javadocs check task
URL: https://github.com/apache/lucene-solr/pull/1267#discussion_r382988664
 
 

 ##########
 File path: gradle/validation/missing-docs-check.gradle
 ##########
 @@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+configure(rootProject) {
+  ext {
+    // too many classes to fix overall to just enable the above to be level="method" right now,
+    // but we can prevent the modules that don't have problems from getting any worse
+    methodLevels = [
+      ':lucene:analysis:icu',
+      ':lucene:analysis:morfologik',
+      ':lucene:analysis:phonetic',
+      ':lucene:analysis:stempel',
+      ':lucene:classification',
+      ':lucene:demo',
+      ':lucene:expressions',
+      ':lucene:facet',
+      ':lucene:join',
+      ':lucene:memory',
+      ':lucene:suggest',
+      ':lucene:spatial3d',
+    ]
+  }
+}
+
+allprojects {
+  plugins.withType(JavaPlugin) {
+
+    // set the default check level for each project
+    def lv = {
+      if (project.path.startsWith(':solr')) 'package'  // todo: add missing docs for all classes and bump this to level=class
+      else if (project.path in rootProject.methodLevels ) 'method'
+      else 'class'
+    }
+
+    task checkMissingDocsDefault(type: CheckMissingDocsTask, dependsOn: 'javadoc') {
+      enabled = project.javadoc.destinationDir.exists()
+      dirs += [ project.javadoc.destinationDir.absolutePath ]
+      level = lv.call()
+    }
+
+    task checkMissingDocs() {
+      group 'Verification'
+      description 'Check missing Javadocs'
+
+      dependsOn checkMissingDocsDefault
+    }
+
+  }
+}
+
+configure(project(':lucene:core')) {
+  plugins.withType(JavaPlugin) {
+
+    // too much to fix core/ for now, but enforce full javadocs for key packages
+    def checkedDirs = [
+      "/org/apache/lucene/util/automaton",
+      "/org/apache/lucene/analysis",
+      "/org/apache/lucene/document",
+      "/org/apache/lucene/search/similarities",
+      "/org/apache/lucene/index",
+      "/org/apache/lucene/codecs"
+    ].collect { path -> "${project.javadoc.destinationDir.absolutePath}${path}" }
+
+    task checkMissingDocsMethod(type: CheckMissingDocsTask, dependsOn: 'javadoc') {
+      dirs = checkedDirs
+      level = 'method'
+    }
+
+    checkMissingDocs {
+      dependsOn checkMissingDocsDefault
+      dependsOn checkMissingDocsMethod
+    }
+
+  }
+}
+
+class CheckMissingDocsTask extends DefaultTask {
+
+  @Input
+  List<String> dirs = []
 
 Review comment:
   changed the definition here to List<File>.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1267: LUCENE-9201: Add missing javadocs check task

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1267: LUCENE-9201: Add missing javadocs check task
URL: https://github.com/apache/lucene-solr/pull/1267#discussion_r382988556
 
 

 ##########
 File path: gradle/validation/missing-docs-check.gradle
 ##########
 @@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+configure(rootProject) {
+  ext {
+    // too many classes to fix overall to just enable the above to be level="method" right now,
+    // but we can prevent the modules that don't have problems from getting any worse
+    methodLevels = [
+      ':lucene:analysis:icu',
+      ':lucene:analysis:morfologik',
+      ':lucene:analysis:phonetic',
+      ':lucene:analysis:stempel',
+      ':lucene:classification',
+      ':lucene:demo',
+      ':lucene:expressions',
+      ':lucene:facet',
+      ':lucene:join',
+      ':lucene:memory',
+      ':lucene:suggest',
+      ':lucene:spatial3d',
+    ]
+  }
+}
+
+allprojects {
+  plugins.withType(JavaPlugin) {
+
+    // set the default check level for each project
+    def lv = {
+      if (project.path.startsWith(':solr')) 'package'  // todo: add missing docs for all classes and bump this to level=class
+      else if (project.path in rootProject.methodLevels ) 'method'
+      else 'class'
+    }
+
+    task checkMissingDocsDefault(type: CheckMissingDocsTask, dependsOn: 'javadoc') {
+      enabled = project.javadoc.destinationDir.exists()
 
 Review comment:
   this is incorrect -- when you run the task on a clean checkout it'd skip the task (because javadoc folder doesn't exist). The empty-folder check should be moved inside the task (if it's at all needed since I assume javadoc should always be present if this task depends on javadoc).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1267: LUCENE-9201: Add missing javadocs check task

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1267: LUCENE-9201: Add missing javadocs check task
URL: https://github.com/apache/lucene-solr/pull/1267#discussion_r382174718
 
 

 ##########
 File path: gradle/validation/missing-docs-check.gradle
 ##########
 @@ -0,0 +1,124 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+allprojects {
+  task checkMissingDocs() {
+    group 'Verification'
+    description 'Check missing Javadocs'
+
+    dependsOn project.tasks.matching { task ->
+      task.name in [ 'checkMissingDocsPackage', 'checkMissingDocsClass', 'checkMissingDocsMethod' ]
+    }
+  }
+}
+
+configure(project(':lucene').subprojects) {
+
+  def methodLevelCheckProjects = [
+    project(':lucene:analysis:icu'),
+    project(':lucene:analysis:morfologik'),
+    project(':lucene:analysis:phonetic'),
+    project(':lucene:analysis:stempel'),
+    project(':lucene:classification'),
+    project(':lucene:demo'),
+    project(':lucene:expressions'),
+    project(':lucene:facet'),
+    project(':lucene:join'),
+    project(':lucene:memory'),
+    project(':lucene:suggest'),
+    project(':lucene:spatial3d')
+  ]
+
+  plugins.withType(JavaPlugin) {
+    if (project in methodLevelCheckProjects) {
+      // too many classes to fix overall to just enable the above to be level="method" right now,
+      // but we can prevent the modules that don't have problems from getting any worse
+      task checkMissingDocsMethod(type: CheckMissingDocsTask, dependsOn: 'javadoc') {
+        enabled = project.javadoc.destinationDir.exists()
+
+        dirs += [ project.javadoc.destinationDir.absolutePath ]
+        level = "method"
+      }
+    } else {
+      task checkMissingDocsClass(type: CheckMissingDocsTask, dependsOn: 'javadoc') {
+        enabled = project.javadoc.destinationDir.exists()
+
+        dirs += [ project.javadoc.destinationDir.absolutePath ]
+        level = "class"
+      }
+    }
+
+    if (project == project(':lucene:core')) {
+
+      def methodLevelCheckDirs = [
+        "/org/apache/lucene/util/automaton",
+        "/org/apache/lucene/analysis",
+        "/org/apache/lucene/document",
+        "/org/apache/lucene/search/similarities",
+        "/org/apache/lucene/index",
+        "/org/apache/lucene/codecs"
+      ].collect { path -> "${project.javadoc.destinationDir.absolutePath}${path}" }
+
+      // too much to fix core/ for now, but enforce full javadocs for key packages
+      task checkMissingDocsMethod(type: CheckMissingDocsTask, dependsOn: 'javadoc') {
 
 Review comment:
   declare task once for all projects, then just configure it appropriately where they deviate?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] mocobeta closed pull request #1267: LUCENE-9201: Add missing javadocs check task

Posted by GitBox <gi...@apache.org>.
mocobeta closed pull request #1267: LUCENE-9201: Add missing javadocs check task
URL: https://github.com/apache/lucene-solr/pull/1267
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1267: LUCENE-9201: Add missing javadocs check task

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1267: LUCENE-9201: Add missing javadocs check task
URL: https://github.com/apache/lucene-solr/pull/1267#discussion_r382988443
 
 

 ##########
 File path: gradle/validation/missing-docs-check.gradle
 ##########
 @@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+configure(rootProject) {
+  ext {
+    // too many classes to fix overall to just enable the above to be level="method" right now,
+    // but we can prevent the modules that don't have problems from getting any worse
+    methodLevels = [
 
 Review comment:
   This can be a local variable, doesn't have to be a root project property (because it's not really needed anywhere else).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] mocobeta commented on issue #1267: LUCENE-9201: Add missing javadocs check task

Posted by GitBox <gi...@apache.org>.
mocobeta commented on issue #1267: LUCENE-9201: Add missing javadocs check task
URL: https://github.com/apache/lucene-solr/pull/1267#issuecomment-590154751
 
 
   I will close this. Thank you @dweiss for your review comments here!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on issue #1267: LUCENE-9201: Add missing javadocs check task

Posted by GitBox <gi...@apache.org>.
dweiss commented on issue #1267: LUCENE-9201: Add missing javadocs check task
URL: https://github.com/apache/lucene-solr/pull/1267#issuecomment-589769041
 
 
   I'll take a look, @mocobeta You always seem to catch me just before I have to leave (time zones...). I'll try to review and clean up the patch tomorrow and post it back here. Thank you for working on this!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on a change in pull request #1267: LUCENE-9201: Add missing javadocs check task

Posted by GitBox <gi...@apache.org>.
dweiss commented on a change in pull request #1267: LUCENE-9201: Add missing javadocs check task
URL: https://github.com/apache/lucene-solr/pull/1267#discussion_r382988460
 
 

 ##########
 File path: gradle/validation/missing-docs-check.gradle
 ##########
 @@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+configure(rootProject) {
+  ext {
+    // too many classes to fix overall to just enable the above to be level="method" right now,
+    // but we can prevent the modules that don't have problems from getting any worse
+    methodLevels = [
+      ':lucene:analysis:icu',
+      ':lucene:analysis:morfologik',
+      ':lucene:analysis:phonetic',
+      ':lucene:analysis:stempel',
+      ':lucene:classification',
+      ':lucene:demo',
+      ':lucene:expressions',
+      ':lucene:facet',
+      ':lucene:join',
+      ':lucene:memory',
+      ':lucene:suggest',
+      ':lucene:spatial3d',
+    ]
+  }
+}
+
+allprojects {
+  plugins.withType(JavaPlugin) {
+
+    // set the default check level for each project
+    def lv = {
 
 Review comment:
   I inlined this inside task definition.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss commented on issue #1267: LUCENE-9201: Add missing javadocs check task

Posted by GitBox <gi...@apache.org>.
dweiss commented on issue #1267: LUCENE-9201: Add missing javadocs check task
URL: https://github.com/apache/lucene-solr/pull/1267#issuecomment-590050376
 
 
   Hi Tomoko. I uploaded a cleaned up patch to jira - please take a look. I'll also add some comments on this pull request so that you know where the changes stem from.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] mocobeta commented on issue #1267: LUCENE-9201: Add missing javadocs check task

Posted by GitBox <gi...@apache.org>.
mocobeta commented on issue #1267: LUCENE-9201: Add missing javadocs check task
URL: https://github.com/apache/lucene-solr/pull/1267#issuecomment-590057882
 
 
   @dweiss thanks for your comments and the refined patch. I did some tests with the patch and added a comment to JIRA. Maybe we should close this PR and complete a patch based on yours.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org