docs/style-guide.md
This style guide is intended to help contributors to GreptimeDB write code that is consistent with the rest of the codebase. It is a living document and will be updated as the codebase evolves.
It's mainly an complement to the Rust Style Guide.
mod declaration before any use.unimplemented!() instead of todo!() for things that aren't likely to be implemented.#[]) and derive (#[derive]).mod.rs to define a module. E.g.:.
├── cache
│ ├── cache_size.rs
│ └── write_cache.rs
└── cache.rs
///) over normal comment (//) for structs, fields, functions etc.[]) to struct, method, or any other reference. And make sure that link works.with_context() over context() when allocation is needed to construct an error.error!() or warn!() macros in the common_telemetry crate to log errors. E.g.:error!(e; "Failed to do something");