protofire / solhint

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

Update examples in the "Configure linter with comments" section #137

Closed fvictorio closed 1 year ago

fvictorio commented 5 years ago

At the very least, the rule used for those examples is deprecated, but the whole section could probably use a revamp too.

ChrisChinchilla commented 5 years ago

Section mentioned is this one - https://github.com/protofire/solhint/blob/master/docs/configuration.md#configure-linter-with-comments

Approval on issue is from @fvictorio help on writing side from @chrischinchilla

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 100.0 DAI (100.0 USD @ $1.0/DAI) attached to it as part of the ConsenSys fund.

akersof commented 5 years ago

@fvictorio can you please explain what do you mean by "the rule used for those examples is deprecated", because i am not sure to understand well if we are talking about the same thing. throw is indeed deprecated in solidity but this is why this rule exists, a warning to the user who tries to use this old solidity feature. So the example in your doc is fine.

/* solhint-disable avoid-throw */
  if (a > 1) {
    throw;
  }
  /* solhint-enable avoid-throw */

By reading the code the comment directive is fine and works well, it avoids to trigger the "throw" is deprecated, avoid to use it. warning. code here Maybe you would mean that we should use other kind of examples (maybe not critical security rules) with or for replacing this one ?

fvictorio commented 5 years ago

Oops, sorry, my bad. I was talking specifically about the compiler-fixed and compiler-gt-0_4 rules, the other ones seem fine.

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 100.0 DAI (100.0 USD @ $1.0/DAI) has been submitted by:

  1. @akersof

@datakarima please take a look at the submitted work:


gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 100.0 DAI (100.0 USD @ $1.0/DAI) attached to this issue has been approved & issued to @akersof.

dbale-altoros commented 1 year ago

This was completed in this PR https://github.com/protofire/solhint/pull/142