duaraghav8 / Ethlint

(Formerly Solium) Code quality & Security Linter for Solidity
https://ethlint.readthedocs.io/en/latest/
MIT License
926 stars 128 forks source link

Allow global configurations #252

Open duaraghav8 opened 5 years ago

duaraghav8 commented 5 years ago

Description User should be able to specify configuration which is applied to all rules. Individual rule configurations should be able to override this global configuration.

Example: Use all rules and treat all as errors. This would mean I extend from solium:all and then apply the global configuration to treat all rules as errors. It could also be flexible to, for example, allow enabling all rules only for a specific plugin (eg- security/* : "error").

I don't have a clear idea on the interface to give to the user for this. This configuration has to go inside soliumrc config file or as CLI option or a combination of both.

Need opinions.

Use case https://github.com/duaraghav8/Ethlint/issues/47#issuecomment-454383076

Screenshots

Alternatives User has to individually list out all the rules and declare their severity as error or warning. This is inconvenient, especially when new releases add new rules which might go un-noticed if they're warnings by default.

Comments

Priority @elenadimitrova?

elenadimitrova commented 5 years ago

For us it's a nice to have feature with overall low priority. However depending on interest others show it may climb up as I imagine more project looking into this.

duaraghav8 commented 5 years ago

@elenadimitrova while this issue may take time to be implemented, I'm shipping another feature which will help you achieve a similar effect.

The CLI option --max-warnings (#255). Linter returns non-0 exit code if number of warnings > value of this option. You could use it with 0 as max tolerable warnings.

solium ... --max-warnings 0 which means even a single warning would fail the build.