diff --git a/.github/workflows/status.yml b/.github/workflows/status.yml index 87c9d2a8..2618229b 100644 --- a/.github/workflows/status.yml +++ b/.github/workflows/status.yml @@ -40,7 +40,9 @@ jobs: - name: Run lint checks id: lint_check run: | - npx ts-node ./status-checks/lint.ts + output=$(npx ts-node ./status-checks/lint.ts) + cat <<< "$output" > "./pr/status-check-output" + echo ${{ github.event.number }} > ./pr/number - uses: actions/upload-artifact@v2 with: name: pr diff --git a/package-lock.json b/package-lock.json index bc7ad39e..bddce094 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,7 @@ "dotenv": "^10.0.0", "hardhat-docgen": "^1.2.0", "inquirer": "^8.2.0", + "markdown-table": "^2.0.0", "minimist": "^1.2.5", "solc": "^0.8.10", "typechain": "^6.0.5" @@ -23415,6 +23416,18 @@ "node": ">=0.10.0" } }, + "node_modules/markdown-table": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-2.0.0.tgz", + "integrity": "sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A==", + "dependencies": { + "repeat-string": "^1.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/match-all": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/match-all/-/match-all-1.2.6.tgz", @@ -49321,6 +49334,14 @@ "object-visit": "^1.0.0" } }, + "markdown-table": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-2.0.0.tgz", + "integrity": "sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A==", + "requires": { + "repeat-string": "^1.0.0" + } + }, "match-all": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/match-all/-/match-all-1.2.6.tgz", diff --git a/package.json b/package.json index edad4d01..227ee23f 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "dotenv": "^10.0.0", "hardhat-docgen": "^1.2.0", "inquirer": "^8.2.0", + "markdown-table": "^2.0.0", "minimist": "^1.2.5", "solc": "^0.8.10", "typechain": "^6.0.5" diff --git a/status-checks/lint.ts b/status-checks/lint.ts index d0cefd4e..fb6b9224 100644 --- a/status-checks/lint.ts +++ b/status-checks/lint.ts @@ -1,5 +1,7 @@ import { readFileSync } from "fs"; import glob from "glob" +//@ts-ignore +import markdownTable from 'markdown-table' interface FileInfo { path: string; @@ -129,13 +131,14 @@ const lint = async () => { } - - console.table(Object.keys(errors).map(filePath => ({ - path: filePath, - errors: errors[filePath] - }))); - if (Object.keys(errors).length > 0) { + console.log(markdownTable) + console.log(markdownTable( + [ + ['File', 'Error'], + ...Object.keys(errors).map(filePath => ([filePath, errors[filePath].join(', ')])) + ] + )) process.exit(1); } }