From d86157f78e179e1b7bd594308e76c2e74cb4a078 Mon Sep 17 00:00:00 2001 From: dbale-altoros Date: Sat, 11 May 2024 18:24:19 -0300 Subject: [PATCH] fix e2e v1 --- CHANGELOG.md | 12 ++++++++++++ e2e/test.js | 2 +- solhint.js | 1 - 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 780446c6..e6792ed4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,19 @@ ## [5.0.0] - 2024-05-11 ### BREAKING CHANGES +#### Solhint EXIT codes +Solhint changed how the exit codes are implemented: +`Exit with 0 code` When execution was ok and there were no errors when evaluating the code according to the rules
+`Exit with 1 code` When execution was ok and there are errors reported
+`Exit with 1 code` When execution was ok and max warnings is lower than the reported warnings
+`Exit with 255 code` When there's an error in the execution (bad config, writing not allowed, wrong parameter, file not found, etc)
+ +#### Solhint QUIET mode +QUIET mode (-c quiet) option now works with the warnings and may exit with 1 if there are more than defined by user + + +

## [4.5.4] - 2024-04-10 ### Fixed - `gas-custom-errors` improved logic to ranged pragma versions [#573](https://github.com/protofire/solhint/pull/573) diff --git a/e2e/test.js b/e2e/test.js index c9c4dc42..abef3aec 100644 --- a/e2e/test.js +++ b/e2e/test.js @@ -188,7 +188,7 @@ describe('e2e', function () { expect(stdout.trim()).to.not.contain(errorFound) }) - it('should NOT display warningns nor error but exit with 1 because max is 3 warnings', function () { + it('should NOT display warnings nor error but exit with 1 because max is 3 warnings', function () { const { code } = shell.exec( `${NODE}solhint ${PREFIX}contracts/Foo.sol --max-warnings 3 ${SUFFIX} -q` ) diff --git a/solhint.js b/solhint.js index 2cdce4da..9eb0b95f 100755 --- a/solhint.js +++ b/solhint.js @@ -309,7 +309,6 @@ function printReports(reports, formatter) { if (program.opts().save) { writeStringToFile(fullReport) } - console.log('maxWarnsFound :>> ', maxWarnsFound) if (maxWarnsFound) process.exit(EXIT_CODES.REPORTED_ERRORS) return reports }