build: lint commits on Chromium roller branches (#49655)

* build: lint commits on Chromium roller branches

Assisted-By: Claude Opus 4.5

* chore: add ability to skip linting CLs by adding #nolint

* chore: only exit with non-zero exit code in CI
This commit is contained in:
David Sanders
2026-02-18 20:45:44 -08:00
committed by GitHub
parent 9ca9311b73
commit efb3fd98c6
4 changed files with 314 additions and 22 deletions

View File

@@ -142,8 +142,29 @@ async function findMatchingFiles (top, test) {
});
}
function compareVersions (v1, v2) {
const [split1, split2] = [v1.split('.'), v2.split('.')];
if (split1.length !== split2.length) {
throw new Error(
`Expected version strings to have same number of sections: ${split1} and ${split2}`
);
}
for (let i = 0; i < split1.length; i++) {
const p1 = parseInt(split1[i], 10);
const p2 = parseInt(split2[i], 10);
if (p1 > p2) return 1;
else if (p1 < p2) return -1;
// Continue checking the value if this portion is equal
}
return 0;
}
module.exports = {
chunkFilenames,
compareVersions,
findMatchingFiles,
getCurrentBranch,
getElectronExec,