rofl.nvim
rofl.nvim copied to clipboard
Can we use linter for all rust code?
Hey guys!
Would be nice to have some lint and format standard on all rust code to improve the readbility and improve the code as soon as possible. Can we use something like clippy and rustfmt on the pipeline process? I can made a PR to integrate these tools.
Thanks!
Yeah, that'd be great! I'm quite new to rust (never worked on a project with other people on it), so either/both of those (whichever people do) I would accept.
Thanks!
I would suggest they are options, not everyone uses rustfmt (yeah I know)... and clippy can give an excess of info that can be distracting.
making them optional in a pipeline would be great though.
If you stick to stable rust, only the upgrade to next stable rust gets might get abit annoying with clippy. The cognitive complexity stuff is however retarded, since it is not minimizing indirection and thereafter the control-flow complexity.
My config is thus to keep it quiet: https://gitlab.redox-os.org/redox-os/ion/-/blob/master/clippy.toml
cognitive-complexity-threshold = 100
type-complexity-threshold = 1000
msrv = "1.53.0"
https://gitlab.redox-os.org/redox-os/ion/-/blob/master/rustfmt.toml could also be used, but frankly changing the defaults of a formatter is annoying. To simplify accessibility I would recommend sticking and enforcing the default.