style-guide
style-guide copied to clipboard
Style guide for PingCAP and TiKV code
Many of the recommendations could be enforced with tools. This could be as simple as flags for rustfmt and clippy, or perhaps custom lints or other tooling
Raised by @brson (see #13) > For crates, I might include language about managing internal mutual dependencies > between modules. Spaghetti internal dependency graphs may be the biggest > obstacles...
perhaps we should combine should and prefer? Many places don't use any, they just have 'use'
There's lots of text and not enough examples atm.
'I' vs 'we' is mentioned in rust/comments.md, but the text itself is not consistent with that usage, we should improve usage in the text and/or change the recommendation.
`default` or `new` (or both). @BusyJay states: "I personally find Default trait is ambiguous. It can hint that the item is singleton but it's not. On the other hand, it...
I am fairly anti- the facade pattern in the guide, mostly based on the negative experience with the std library. However, there is some disagreement, so perhaps it is worth...