build: lint patches for trailing whitespace (#26007)
This commit is contained in:
parent
6b6ffbdd10
commit
042ebdd5b0
6 changed files with 17 additions and 12 deletions
|
@ -186,6 +186,11 @@ const LINTERS = [{
|
|||
console.warn(`Patch file '${f}' has no description. Every patch must contain a justification for why the patch exists and the plan for its removal.`);
|
||||
ok = false;
|
||||
}
|
||||
const trailingWhitespace = patchText.split('\n').filter(line => line.startsWith('+')).some(line => /\s+$/.test(line));
|
||||
if (trailingWhitespace) {
|
||||
console.warn(`Patch file '${f}' has trailing whitespace on some lines.`);
|
||||
ok = false;
|
||||
}
|
||||
});
|
||||
if (!ok) {
|
||||
process.exit(1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue