Closed LefterisJP closed 6 years ago
Agreed, I believe the solidity style guide's rules are more suited as an optional ruleset (the current default ruleset is solium:all
that you see in your .soliumrc.json
which basically applies all the rules).
IMO here is how we can improve the linter:
solium:style-guide
, solium:knr-gnu
, etc or sharable configs for that matter) that one can switch to.solium --init
will be solium:recommended
- this itself would contain only a small no. of style rules which would generally apply to all solidity code (so wouldn't complain about your variable naming style for example)I'll be working on it in the coming days. Feel free to give your input on this^, thanks for the detailed feedback!
v1.1.3 introduces the solium:recommended
ruleset - https://github.com/duaraghav8/Solium/blob/master/config/rulesets/solium-recommended.js.
Would love to hear you out in case you have more feedback.
Hey,
I recently integrated solium to emacs solidity mode. It's great but also rather opinionated. It follows a particular style whoever wrote solidity's read the docs liked (camelcase) and makes anything else appear as errors or warnings.
I know that these can be configured and turned off but it would be better if the user could avoid style suggestions unless requested. I find it annoying to have to disable all style rules. And for my styling rules there is no enforcement. For example I can't enforce snake case.
Examples of opinionated errors:
And the last 2 should only have been warnings. There is no error involved. It's a style choice to have the brace like that, and a rather popular one called K&R.
Also this warning is rather off:
It is not the number of arguments that count but the number of columns they take. Most projects I have worked in always keep arguments in one line, unless the function call exceeds the XX column limit (with XX being either 80 or 100) in which case yes indeed each argument is split into its own line.
I suggest having style choices grouped into something like the different indentation styles seen here and allow the user to choose one and then fine-tune through specific options. But not only support the camelcase style that is supported now.
If you want to have a style linter make it one that can be used by all groups, not only one particular style.