MCPcopy Index your code
hub / github.com/code-pushup/cli / configureLcovReporter

Function configureLcovReporter

packages/plugin-coverage/src/lib/binding.ts:158–179  ·  view source on GitHub ↗

Returns true if lcov reporter is already present or was successfully added.

(
  options: CoverageOptions,
  tree?: PluginSetupTree,
)

Source from the content-addressed store, hash-verified

156
157/** Returns true if lcov reporter is already present or was successfully added. */
158async function configureLcovReporter(
159 options: CoverageOptions,
160 tree?: PluginSetupTree,
161): Promise<boolean> {
162 const { framework, configFile } = options;
163 if (framework === 'other' || !configFile || !tree) {
164 return false;
165 }
166 const content = await tree.read(configFile);
167 if (content == null) {
168 return false;
169 }
170 if (hasLcovReporter(content, framework)) {
171 return true;
172 }
173 const modified = addLcovReporter(content, framework);
174 if (modified === content) {
175 return false;
176 }
177 await tree.write(configFile, modified);
178 return true;
179}
180
181function formatPluginInit(
182 options: CoverageOptions,

Callers 1

binding.tsFile · 0.85

Calls 2

hasLcovReporterFunction · 0.85
addLcovReporterFunction · 0.85

Tested by

no test coverage detected