Compare commits

..

1 commit

Author SHA1 Message Date
renovate[bot]
5ff3254cee
chore(deps): update dependency typescript to v5.6.2 2024-09-09 18:32:36 +00:00
4 changed files with 8 additions and 48 deletions

View file

@ -12,9 +12,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Install yarn
run: npm i -g yarn
- name: Set up Node
uses: actions/setup-node@v3
with:
@ -41,9 +38,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Install yarn
run: npm i -g yarn
- name: Set up Node
uses: actions/setup-node@v3
with:

View file

@ -48,40 +48,6 @@ export const validate = async (argv: Argv) => {
}
};
async function isGitRepo() {
const isGit = await exec(`git rev-parse --is-inside-work-tree`);
return isGit.code === 0;
}
async function isSaplingRepo() {
const isSapling = await exec(`sl root`);
return isSapling.code === 0;
}
async function getDiff(): Promise<string | undefined> {
if (await isGitRepo()) {
const diffText = await exec(`git diff origin/HEAD...HEAD`);
if (diffText.code > 0) {
error("Error loading the diff\n\n" + diffText.stderr);
return undefined;
}
return diffText.stdout;
}
if (await isSaplingRepo()) {
const diffText = await exec(`sl diff -g -r '. % public()'`);
if (diffText.code > 0) {
error("Error loading the diff\n\n" + diffText.stderr);
return undefined;
}
return diffText.stdout;
}
error("Unable to get a diff no repo was found\n");
}
export const run = async (argv = process.argv) => {
const parsed: Argv = await yargs(hideBin(argv)).options(options).argv;
const validationError = await validate(parsed);
@ -96,12 +62,12 @@ export const run = async (argv = process.argv) => {
return lcovDiff(baseCoverage, compareCoverage);
}
const diffText = await getDiff();
if (!diffText) {
return;
const diffText = await exec(`git diff origin/HEAD...HEAD`);
if (diffText.code > 0) {
return error("Error loading the diff\n\n" + diffText.stderr);
}
const diff = parseDiff.default(diffText);
const diff = parseDiff.default(diffText.stdout);
const { percentage } = report(diff, baseCoverage);
process.exit(percentage > 90 ? 0 : 1);

View file

@ -1,7 +1,7 @@
const getCoverageForFile = (file: any, coverage: any) => {
for (const cov of coverage) {
const report: { [k: number]: number } = {};
if (cov.file.replace("./", "") === file.to) {
if (cov.file === file.to) {
for (const detail of cov.lines.details) {
report[detail.line] = detail.hit;
}

View file

@ -2828,9 +2828,9 @@ type-fest@^0.21.3:
integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==
typescript@^5.1.6:
version "5.2.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78"
integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==
version "5.6.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.2.tgz#d1de67b6bef77c41823f822df8f0b3bcff60a5a0"
integrity sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==
undici-types@~5.26.4:
version "5.26.5"