mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
build: lint patches for trailing whitespace (#26007)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user