add level=none option so we can find more broken html in solr javadocs

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1383047 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2012-09-10 19:00:45 +00:00
parent fab19135fd
commit a4ea891571
2 changed files with 7 additions and 5 deletions

View File

@ -302,8 +302,8 @@ def checkPackageSummaries(root, level='class'):
True if there are problems.
"""
if level != 'class' and level != 'package' and level != 'method':
print('unsupported level: %s, must be "class" or "package" or "method"' % level)
if level != 'class' and level != 'package' and level != 'method' and level != 'none':
print('unsupported level: %s, must be "class" or "package" or "method" or "none"' % level)
sys.exit(1)
#for dirPath, dirNames, fileNames in os.walk('%s/lucene/build/docs/api' % root):
@ -329,7 +329,7 @@ def checkPackageSummaries(root, level='class'):
continue
if 'package-summary.html' in fileNames:
if level != 'package' and checkSummary('%s/package-summary.html' % dirPath):
if (level == 'class' or level == 'method') and checkSummary('%s/package-summary.html' % dirPath):
anyMissing = True
for fileName in fileNames:
fullPath = '%s/%s' % (dirPath, fileName)
@ -342,14 +342,14 @@ def checkPackageSummaries(root, level='class'):
anyMissing = True
if 'overview-summary.html' in fileNames:
if checkSummary('%s/overview-summary.html' % dirPath):
if level != 'none' and checkSummary('%s/overview-summary.html' % dirPath):
anyMissing = True
return anyMissing
if __name__ == '__main__':
if len(sys.argv) < 2 or len(sys.argv) > 3:
print('usage: %s <dir> [class|package|method]' % sys.argv[0])
print('usage: %s <dir> [none|package|class|method]' % sys.argv[0])
sys.exit(1)
if len(sys.argv) == 2:
level = 'class'

View File

@ -551,6 +551,8 @@
<!-- TODO: also integrate checkJavaDocs.py, which does more checks -->
<target name="javadocs-lint" depends="javadocs">
<check-broken-links dir="build/docs"/>
<!-- TODO: add missing package.htmls and bump this to level=package -->
<!-- <check-missing-javadocs dir="build/docs" level="none"/> -->
</target>
<!-- install-maven-tasks is *not* a useless dependency. do not remove -->