INNER CODE UNIT · JavaScript
lead
karanb192/claude-code-hooks · plugins/bounty-board/bounty-board.js:147
const lead = line.match(/^\s*(?:\*|--|;)/);
if (lead) candidates.push(lead[0].length - 1);
return candidates.length ? Math.min(...candidates) : -1;
}
/**
* Scan a single line; returns the first matching rule or null.
* Comment-kind rules (TODO/FIXME/…) only match inside a comment span, so
* `const url = "https://x.com/TODO"` or a TODO in a string literal doesn't
* become a bounty. Test/lint rules match code constructs, so they see the
* whole line.
*/
function classifyLine(line) {
if (!line || line.length > MAX_LINE_LEN) return null;
let commentSpan;
for (const rule of RULES) {
if (rule.kind === 'comment') {
if (commentSpan === undefined) {