mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
build: lint commits on Chromium roller branches (#49862)
* build: lint commits on Chromium roller branches Assisted-By: Claude Opus 4.5 Co-authored-by: David Sanders <dsanders11@ucsbalum.com> * chore: add ability to skip linting CLs by adding #nolint Co-authored-by: David Sanders <dsanders11@ucsbalum.com> * chore: only exit with non-zero exit code in CI Co-authored-by: David Sanders <dsanders11@ucsbalum.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user