Skip to content

Commit ab83eb7

Browse files
committedJul 29, 2024
fix: exit check task with exit code 1 when solhint raises errors
1 parent daa10da commit ab83eb7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
 

‎packages/hardhat-solhint/src/index.ts

+11
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,15 @@ task("check", async (_, { run }, runSuper) => {
127127
const reports = await run("hardhat-solhint:run-solhint");
128128

129129
printReport(reports);
130+
131+
const errorsCount = reports.reduce(
132+
(acc: number, i: { errorCount: number }) => {
133+
return acc + i.errorCount;
134+
},
135+
0
136+
);
137+
138+
if (errorsCount > 0) {
139+
process.exit(1);
140+
}
130141
});

0 commit comments

Comments
 (0)
Please sign in to comment.