Compare commits

...

6 commits
pr57 ... 0.x

Author SHA1 Message Date
3e3d0b5a9d feat: sapling scm support
All checks were successful
CI / Lint (pull_request) Successful in 29s
CI / Test Node (pull_request) Successful in 32s
Conventional Tools Commitlint / Commitlint (pull_request) Successful in 5s
CI / Lint (push) Successful in 27s
CI / Test Node (push) Successful in 32s
Conventional Tools Commitlint / Commitlint (push) Successful in 5s
Now you can run this inside a sapling repo. It will automatically pick what
source control you are using by checking for the root repo.
2024-09-17 08:29:43 +01:00
7610b3bef5 ci: install yarn for actions on forgejo (#2)
All checks were successful
CI / Lint (push) Successful in 29s
CI / Test Node (push) Successful in 31s
Conventional Tools Commitlint / Commitlint (push) Successful in 5s
Summary:

The forgejo action use act under the hood. The default image does not have yarn
installed so, this is installing it.

Test Plan:

CI

Reviewed By: AdeAttwood

Pull Request: #2
Co-authored-by: Ade Attwood <adrian.attwood@marketdojo.com>
Co-committed-by: Ade Attwood <adrian.attwood@marketdojo.com>
2024-09-17 07:13:34 +00:00
renovate[bot]
0d9a76760d chore(deps): update testing packages 2024-01-23 09:02:13 +00:00
renovate[bot]
903e29b7d1 chore(deps): update eslint packages to v6.19.1 2024-01-23 08:09:18 +00:00
renovate[bot]
ff506d4679 chore(deps): lock file maintenance 2024-01-14 16:01:53 +00:00
1b3a85465f chore: update eslint prettier
This updates the following packages, they need to be updated together.

- eslint-config-prettier
- eslint-plugin-prettier
2024-01-14 15:56:21 +00:00
5 changed files with 670 additions and 745 deletions

View file

@ -12,6 +12,9 @@ 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:
@ -38,6 +41,9 @@ 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

@ -36,8 +36,8 @@
"@typescript-eslint/eslint-plugin": "^6.4.1",
"@typescript-eslint/parser": "^6.4.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"jest": "^29.6.4",
"prettier": "^3.0.2",
"ts-jest": "^29.1.1",

View file

@ -48,6 +48,40 @@ 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);
@ -62,12 +96,12 @@ export const run = async (argv = process.argv) => {
return lcovDiff(baseCoverage, compareCoverage);
}
const diffText = await exec(`git diff origin/HEAD...HEAD`);
if (diffText.code > 0) {
return error("Error loading the diff\n\n" + diffText.stderr);
const diffText = await getDiff();
if (!diffText) {
return;
}
const diff = parseDiff.default(diffText.stdout);
const diff = parseDiff.default(diffText);
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 === file.to) {
if (cov.file.replace("./", "") === file.to) {
for (const detail of cov.lines.details) {
report[detail.line] = detail.hit;
}

1361
yarn.lock

File diff suppressed because it is too large Load diff