This commit is contained in:
Georges KABBOUCHI 2022-07-08 20:40:41 +03:00
parent 1372abe5e8
commit dea7ce3da0
4 changed files with 34 additions and 7 deletions

View File

@ -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

21
package-lock.json generated
View File

@ -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",

View File

@ -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"

View File

@ -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);
}
}