blob: 312803972bf40621fcf66761e43eae1edf650fc8 [file] [edit]
---
title: 'coverage\_common'
---
Helper functions to access coverage-related infrastructure.
## Members
* [instrumented\_files\_info](#instrumented_files_info)
## instrumented\_files\_info
```
InstrumentedFilesInfo coverage_common.instrumented_files_info(ctx, *, source_attributes=[], dependency_attributes=[], extensions=None, metadata_files=[])
```
Creates a new [InstrumentedFilesInfo](/versions/8.0.1/rules/lib/providers/InstrumentedFilesInfo) instance. Use this provider to communicate coverage-related attributes of the current build rule.
### Parameters
| Parameter | Description |
| --- | --- |
| `ctx` | [ctx](/versions/8.0.1/rules/lib/builtins/ctx); required The rule context. |
| `source_attributes` | [sequence](/versions/8.0.1/rules/lib/core/list); default is `[]` A list of attribute names which contain source files processed by this rule. |
| `dependency_attributes` | [sequence](/versions/8.0.1/rules/lib/core/list); default is `[]` A list of attribute names which might provide runtime dependencies (either code dependencies or runfiles). |
| `extensions` | [sequence](/versions/8.0.1/rules/lib/core/list) of [string](/versions/8.0.1/rules/lib/core/string)s; or `None`; default is `None` File extensions used to filter files from source\_attributes. For example, 'js'. If not provided (or None), then all files from source\_attributes will be added to instrumented files, if an empty list is provided, then no files from source attributes will be added. |
| `metadata_files` | [sequence](/versions/8.0.1/rules/lib/core/list) of [File](/versions/8.0.1/rules/lib/builtins/File)s; default is `[]` Additional files required to generate coverage LCOV files after code execution. e.g. .gcno files for C++. |