MCPcopy Index your code
hub / github.com/github/awesome-copilot / sectionSteps

Function sectionSteps

extensions/java-modernization-studio/scan.mjs:210–226  ·  view source on GitHub ↗
(md, headingRe)

Source from the content-addressed store, hash-verified

208// gates to an explicit "Validation gates" section so unrelated checklist items
209// that merely mention "build"/"vulnerable"/etc. don't hijack a gate's status.
210function sectionSteps(md, headingRe) {
211 if (!md) return null;
212 let inSection = false;
213 const buf = [];
214 for (const line of md.split(/\r?\n/)) {
215 const h = line.match(/^\s*#{1,6}\s+(.*\S)\s*$/);
216 if (h) {
217 if (inSection) break; // next heading closes the section
218 if (headingRe.test(h[1])) inSection = true;
219 continue;
220 }
221 if (inSection) buf.push(line);
222 }
223 if (!inSection) return null;
224 const steps = parseSteps(buf.join("\n"));
225 return steps.length ? steps : null;
226}
227
228function percentDone(steps) {
229 if (!steps.length) return 0;

Callers 1

scanRepoFunction · 0.85

Calls 1

parseStepsFunction · 0.85

Tested by

no test coverage detected