-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically check if modules are left out of the API docs #714
Comments
/cc @tseaver We may be able to handle this with http://sphinx-doc.org/ext/coverage.html |
I will try to enable |
Per Takayuki Shimizukawa's EP 2015 presentation, the extension generates a ReST report for undocumented modules/classes/functions, but there is no CI integration for it: the command always succeeds, and does not generate a useful machine-readable file we could interrogate. |
I have a hacky but short way to check this. import os
import warnings
from sphinx.ext.intersphinx import fetch_inventory
class SphinxApp(object):
warn = warnings.warn
srcdir = os.path.abspath('.')
I = fetch_inventory(SphinxApp, '',
os.path.join('docs', '_build', 'html', 'objects.inv'))
sphinx_mods = I['py:module'].keys()
py_files = []
for path, _, files in os.walk('gcloud'):
if any([part.startswith('_')
for part in path.split(os.path.sep)]):
continue
for fi in files:
if (fi.endswith('.py') and not fi.startswith('test_')
and not fi.startswith('_')):
py_files.append(os.path.join(path, fi))
mods = [fi[:-3].replace(os.path.sep, '.') for fi in py_files]
print set(sphinx_mods) - set(mods)
print set(mods) - set(sphinx_mods) Running this results in an empty set (everything in {'gcloud.bigquery.query',
'gcloud.bigtable.client',
'gcloud.bigtable.cluster',
'gcloud.bigtable.column_family',
'gcloud.bigtable.row',
'gcloud.bigtable.table',
'gcloud.datastore.demo.demo',
'gcloud.datastore.helpers',
'gcloud.demo',
'gcloud.environment_vars',
'gcloud.iterator',
'gcloud.storage.batch',
'gcloud.storage.demo.demo',
'gcloud.streaming.buffered_stream',
'gcloud.streaming.exceptions',
'gcloud.streaming.http_wrapper',
'gcloud.streaming.stream_slice',
'gcloud.streaming.transfer',
'gcloud.streaming.util'} We could do as we do in @tseaver WDYT? |
- [ ] Regenerate this pull request now. Source-Link: googleapis/googleapis@6b3fdce Source-Link: googleapis/googleapis-gen@832dbe9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODMyZGJlOTk4ODc4ZDg2MTlkNmI0MGZlNTdjNmQyY2M2ZTdkYzkwYyJ9
See previous comment for context.
The text was updated successfully, but these errors were encountered: