Merge pull request #180 from Instadapp/workflow-update

Workflow update
This commit is contained in:
Thrilok kumar 2022-03-03 20:34:03 +05:30 committed by GitHub
commit 010af63368
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 11 deletions

View File

@ -33,7 +33,7 @@ jobs:
id: status_check id: status_check
run: | run: |
# Run status checks, Remove ANSI colors from the text # Run status checks, Remove ANSI colors from the text
output=$(node ./status-checks | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g') output=$(ts-node ./status-checks/index.ts | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g')
# Escape newlines so _all_ the output is included in the set-output # Escape newlines so _all_ the output is included in the set-output
output="${output//'%'/'%25'}" output="${output//'%'/'%25'}"
output="${output//$'\n'/'%0A'}" output="${output//$'\n'/'%0A'}"

View File

@ -6,8 +6,8 @@
"scripts": { "scripts": {
"test": "hardhat run scripts/tests/global-test.ts", "test": "hardhat run scripts/tests/global-test.ts",
"coverage": "./node_modules/.bin/solidity-coverage", "coverage": "./node_modules/.bin/solidity-coverage",
"check": "node status-checks/huskyCheck.js", "check": "ts-node status-checks/huskyCheck.ts",
"check-husky": "node status-checks/huskyCheck.js", "check-husky": "ts-node status-checks/huskyCheck.ts",
"deploy": "node scripts/deployConnectorsFromCmd.js", "deploy": "node scripts/deployConnectorsFromCmd.js",
"test:runner": "hardhat run scripts/tests/run-tests.ts", "test:runner": "hardhat run scripts/tests/run-tests.ts",
"typechain": "hardhat typechain", "typechain": "hardhat typechain",

View File

@ -92,7 +92,7 @@ const checkEvents = async (connector: {
const eventsPath = `${connector.path}/events.sol`; const eventsPath = `${connector.path}/events.sol`;
const mainPath = `${connector.path}/main.sol`; const mainPath = `${connector.path}/main.sol`;
if (connector.events.length) { if (connector.events.length) {
const eventNames = []; const eventNames:string[] = [];
for (let i1 = 0; i1 < connector.mainEvents.length; i1++) { for (let i1 = 0; i1 < connector.mainEvents.length; i1++) {
const mainEvent = connector.mainEvents[i1]; const mainEvent = connector.mainEvents[i1];
const name = mainEvent.split("(")[0]; const name = mainEvent.split("(")[0];
@ -131,7 +131,7 @@ const checkEvents = async (connector: {
} }
} }
if (connector.mainEvents.length < connector.events.length) { if (connector.mainEvents.length < connector.events.length) {
const deprecatedEvents = connector.events.filter((e) => { const deprecatedEvents = connector.events.filter((e: string) => {
let used = false; let used = false;
for (let index = 0; index < eventNames.length; index++) { for (let index = 0; index < eventNames.length; index++) {
if (e.split("(")[0].split(" ")[1] === eventNames[index]) if (e.split("(")[0].split(" ")[1] === eventNames[index])
@ -157,7 +157,7 @@ const checkEvents = async (connector: {
const getCommments = async (strs: string | any[]) => { const getCommments = async (strs: string | any[]) => {
try { try {
const comments = []; const comments = [];
let type: string; let type: string = '';
for (let index = strs.length - 1; index >= 0; index--) { for (let index = strs.length - 1; index >= 0; index--) {
const str = strs[index]; const str = strs[index];
if (!type) { if (!type) {
@ -194,9 +194,9 @@ const parseCode = async (connector: { path: any; code?: any }) => {
const eventsFirstLines = []; const eventsFirstLines = [];
let func = []; let func = [];
let funcs = []; let funcs = [];
let event = []; let event: string[] = [];
let mainEvents = []; let mainEvents: string[] = [];
let firstLine: number; let firstLine: number = -1;
let mainEventsLines = []; let mainEventsLines = [];
for (let index = 0; index < strs.length; index++) { for (let index = 0; index < strs.length; index++) {
const str = strs[index]; const str = strs[index];
@ -297,7 +297,7 @@ const parseCode = async (connector: { path: any; code?: any }) => {
} }
}; };
const checkComments = async (connector) => { const checkComments = async (connector:any) => {
try { try {
const errors = []; const errors = [];
for (let i1 = 0; i1 < connector.funcs.length; i1++) { for (let i1 = 0; i1 < connector.funcs.length; i1++) {
@ -317,7 +317,7 @@ const checkComments = async (connector) => {
} }
const reqs = ["@dev", "@notice"]; const reqs = ["@dev", "@notice"];
for (let i3 = 0; i3 < reqs.length; i3++) { for (let i3 = 0; i3 < reqs.length; i3++) {
if (!func.comments.some((comment) => comment.startsWith(reqs[i3]))) { if (!func.comments.some((comment:string) => comment.startsWith(reqs[i3]))) {
errors.push( errors.push(
`no ${reqs[i3]} for function ${func.name} at ${connector.path}/main.sol:${func.firstLine}` `no ${reqs[i3]} for function ${func.name} at ${connector.path}/main.sol:${func.firstLine}`
); );