duaraghav8 / Ethlint

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

[Feature request] Add "dynamic" option for the rule "linebreak-style" #237

Closed jackycjh closed 6 years ago

jackycjh commented 6 years ago

Problem encountered

While using a VS Code extension juanblanco.solidity (repository: https://github.com/juanfranblanco/vscode-solidity) on a Windows platform, the default rule of linebreak-style is unable to determine the OS platform it's running on, when the extension runs the Solium linter.

Reference

More info at: https://github.com/juanfranblanco/vscode-solidity/issues/86

Ideal feature/improvement

According to implementation in https://github.com/duaraghav8/Solium/blob/master/lib/rules/linebreak-style.js Ideally add another option string "dynamic" and detect the OS platform using process.platform to determine whether the linebreak style should be LF or CRLF?

Disclaimer: I'm not a JS expert, reference found from https://stackoverflow.com/a/8684009/4003061

duaraghav8 commented 6 years ago

@jackycjh Actually this rule (or the whole of Solium) doesn't require the dynamic option. Ideally, Solium's rules should detect the platform and modify their behaviour. There are currently bugs in Solium (related to linebreak style) causing it to be incompatible with Windows at the moment. I'd highly recommend you use Solium in a Unix or Darwin environment for now. These bugs are going to take some time to get fixed, since they're all part of legacy code.

jackycjh commented 6 years ago

Noted, thanks for the explanation.

Will look forward for getting Solium works nicely in Windows, hopefully also works in the ideal fashion that it could detect and modify the rule preferences.

duaraghav8 commented 6 years ago

Please feel free to re-open the issue in case you face any other related problem :)