protofire / solhint

Solhint is an open-source project to provide a linting utility for Solidity code.
https://protofire.github.io/solhint/
MIT License
1.03k stars 160 forks source link

Setup solhint to fail github CI on any warning with `--max-warnings 0` #460

Closed vladikopl01 closed 1 year ago

vladikopl01 commented 1 year ago

I set up solhint for GitHub CI workflow as a linter for solidity files: solhint --max-warnings 0 \"contracts/**/*.sol\". But CI is not failing on warnings provided by solhint.

How could it be implemented? Thanks

dbale-altoros commented 1 year ago

@vladikopl01 There was an issue with max warnings which is fixed here: https://github.com/protofire/solhint/pull/439/files

FYI: When setting max-warnings, if solhint finds more than the number configured, it should exit with code 1 and a message: Solhint found more warnings than the maximum specified This will be the behavior

dbale-altoros commented 1 year ago

@vladikopl01 New version is released Please try it and let me know if you have any issue

0xCourtney commented 1 year ago

@vladikopl01 New version is released Please try it and let me know if you have any issue

Just tested this out and it works fine for us.

dbale-altoros commented 1 year ago

@0xCourtney thanks a lot for that!