(root, path, pattern, label, { ignoreVersions = new Set() } = {})
| 263 | } |
| 264 | |
| 265 | async function readRuntimeVersions(root, path, pattern, label, { ignoreVersions = new Set() } = {}) { |
| 266 | const source = await readFile(resolve(root, path), 'utf8'); |
| 267 | const versions = [...source.matchAll(pattern)].map((match) => match[1]).filter((version) => !ignoreVersions.has(version)); |
| 268 | if (versions.length === 0) { |
| 269 | return [{ label: `${label} (${path}; missing version)`, version: undefined }]; |
| 270 | } |
| 271 | return versions.map((version, index) => ({ |
| 272 | label: versions.length === 1 ? `${label} (${path})` : `${label} ${index + 1} (${path})`, |
| 273 | version, |
| 274 | })); |
| 275 | } |
| 276 | |
| 277 | export async function checkReleaseCoherence(root = repositoryRoot) { |
| 278 | const errors = auditReleaseCoherence(await readReleaseCoherenceInput(root)); |
no test coverage detected