From 0b0d0af116cb2a6ca0c9c1fe318646836ce49c9c Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Wed, 28 Jun 2023 20:58:29 +0100 Subject: [PATCH] e2e fix, properties to solhint payload --- apps/remix-ide-e2e/src/tests/staticAnalysis.test.ts | 4 ++-- apps/solhint/src/app/SolhintPluginClient.ts | 8 ++++++-- .../static-analyser/src/lib/remix-ui-static-analyser.tsx | 7 ------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/staticAnalysis.test.ts b/apps/remix-ide-e2e/src/tests/staticAnalysis.test.ts index 6f602ef94c..64457204c0 100644 --- a/apps/remix-ide-e2e/src/tests/staticAnalysis.test.ts +++ b/apps/remix-ide-e2e/src/tests/staticAnalysis.test.ts @@ -43,14 +43,14 @@ module.exports = { .click('*[id="staticAnalysisRunBtn"]') .waitForElementPresent('#staticanalysisresult .warning', 5000) // Check warning count - .click('*[data-rb-event-key="basic"]') + .click('*[data-rb-event-key="remix"]') .assert.containsText('span#ssaRemixtab > *[data-id="RemixStaticAnalysisErrorCount"]', '1') .verify.elementPresent('input[name="showLibWarnings"]') .verify.not.elementPresent('input[name="showLibWarnings"]:checked') .verify.elementPresent('label[id="headingshowLibWarnings"]') .click('label[id="headingshowLibWarnings"]') .pause(1000) - .click('*[data-rb-event-key="basic"]') + .click('*[data-rb-event-key="remix"]') .assert.containsText('span#ssaRemixtab > *[data-id="RemixStaticAnalysisErrorCount', '382') .click('label[id="headingshowLibWarnings"]') .pause(1000) diff --git a/apps/solhint/src/app/SolhintPluginClient.ts b/apps/solhint/src/app/SolhintPluginClient.ts index 8cfef7fbe2..e386096114 100644 --- a/apps/solhint/src/app/SolhintPluginClient.ts +++ b/apps/solhint/src/app/SolhintPluginClient.ts @@ -85,10 +85,14 @@ export class SolHint extends PluginClient { const reports: Array = reporters.reports const hints = reports.map((report: Report) => { return { - formattedMessage: `${report.message}\n${report.fix ? report.fix : ''}`, + formattedMessage: `${report.message}\n ${report.fix ? report.fix : ''}`, type: this.severity[report.severity] || 'error', column: report.column, - line: report.line - 1 + line: report.line - 1, + message: report.message, + ruleId: report.ruleId, + severity: report.severity, + fix: report.fix } }) diff --git a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx index c949814529..d82c0b6318 100644 --- a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx +++ b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx @@ -698,13 +698,6 @@ useEffect(() => { })) }).flat().every(el => categoryIndex.includes(el)) } - useEffect(() => { - const getLastCompiled = async () => { - const lastComp = await props.analysisModule.call('compilerArtefacts', 'getLastCompilationResult') - console.log({ lastComp }) - } - getLastCompiled() - }, [props, state]) return (