sphinx.ext.coverage -- ドキュメントのカバレッジの状況を収集します¶
この拡張機能には CoverageBuilder という追加のビルダーが一つ含まれます。
注釈
The sphinx-apidoc command can be used to automatically generate API documentation for all code in a project, avoiding the need to manually author these documents and keep them up-to-date.
警告
coverage imports the modules to be documented.
If any modules have side effects on import,
these will be executed by the coverage builder when sphinx-build is run.
もしあなたが (ライブラリモジュールではなく) スクリプトをドキュメント化したいのであれば、スクリプトのメインルーチンが if __name__ == '__main__' 条件により保護されていることを確認して下さい。
注釈
For Sphinx (actually, the Python interpreter that executes Sphinx)
to find your module, it must be importable.
That means that the module or the package must be in
one of the directories on sys.path -- adapt your sys.path
in the configuration file accordingly.
To use this builder, activate the coverage extension in your configuration file
and run sphinx-build -M coverage on the command line.
Builder¶
設定¶
ビルダーがチェックすべきものを決定するための、いくつかの設定値も追加されます:
- coverage_modules¶
- タイプ:
Sequence[str]- デフォルト:
()
List of Python packages or modules to test coverage for. When this is provided, Sphinx will introspect each package or module provided in this list as well as all sub-packages and sub-modules found in each. When this is not provided, Sphinx will only provide coverage for Python packages and modules that it is aware of: that is, any modules documented using the
py:moduledirective provided in the Python domain or theautomoduledirective provided by theautodocextension.Added in version 7.4.
- coverage_ignore_modules¶
- coverage_ignore_functions¶
- coverage_ignore_classes¶
- coverage_ignore_pyobjects¶
- タイプ:
Sequence[str]- デフォルト:
()
Python regular expressions のリスト。
これらの正規表現のいずれかがPythonオブジェクトのインポートフルパスのいずれかの部分と一致する場合、そのPythonオブジェクトはドキュメントカバレッジのレポートから除外されます。
Added in version 2.1.
- coverage_c_path¶
- タイプ:
Sequence[str]- デフォルト:
()
- coverage_c_regexes¶
- タイプ:
dict[str, str]- デフォルト:
{}
- coverage_ignore_c_items¶
- タイプ:
dict[str, Sequence[str]]- デフォルト:
{}
- coverage_write_headline¶
- タイプ:
bool- デフォルト:
True
もし
Falseが設定されると、ヘッドラインを出力しなくなります。Added in version 1.1.
- coverage_skip_undoc_in_source¶
- タイプ:
bool- デフォルト:
False
Skip objects that are not documented in the source with a docstring.
Added in version 1.1.
- coverage_show_missing_items¶
- タイプ:
bool- デフォルト:
False
Print objects that are missing to standard output also.
Added in version 3.1.
- coverage_statistics_to_report¶
- タイプ:
bool- デフォルト:
True
Print a tabular report of the coverage statistics to the coverage report.
Example output:
+-----------------------+----------+--------------+ | Module | Coverage | Undocumented | +=======================+==========+==============+ | package.foo_module | 100.00% | 0 | +-----------------------+----------+--------------+ | package.bar_module | 83.33% | 1 | +-----------------------+----------+--------------+
Added in version 7.2.
- coverage_statistics_to_stdout¶
- タイプ:
bool- デフォルト:
False
Print a tabular report of the coverage statistics to standard output.
Example output:
+-----------------------+----------+--------------+ | Module | Coverage | Undocumented | +=======================+==========+==============+ | package.foo_module | 100.00% | 0 | +-----------------------+----------+--------------+ | package.bar_module | 83.33% | 1 | +-----------------------+----------+--------------+
Added in version 7.2.