Update verify.js
parent
c254f01844
commit
a12252155c
|
|
@ -83,8 +83,15 @@ const todos = (file) => {
|
||||||
|
|
||||||
for (let i = 0; i < lines.length; i++) {
|
for (let i = 0; i < lines.length; i++) {
|
||||||
const line = lines[i];
|
const line = lines[i];
|
||||||
const match = line.match(/\/\/\s*todo([([].*?[)\]])?\s*:?\s*(.*)/i);
|
// Match various TODO comment styles and capture the trailing text
|
||||||
if (match) items.push([i + 1, line, match[0], match[1], match[2]]);
|
const match = line.match(/\/\/\s*todo(?:\s*[::-])?\s*(.*)/i);
|
||||||
|
if (match) {
|
||||||
|
// Ignore translation placeholder TODOs (these are expected in many packs)
|
||||||
|
const text = (match[1] || '').trim();
|
||||||
|
if (/^translate$/i.test(text) || (/translate/i.test(text) && text.length < 40))
|
||||||
|
continue;
|
||||||
|
items.push([i + 1, line, match[0], match[1]]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return items;
|
return items;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue