Prompt
Maintain consistent formatting throughout the codebase to improve readability and maintainability. This includes standardizing function declaration spacing, comment styles, pointer/reference formatting, and type naming conventions.
Key formatting rules to follow:
- Function declarations: Use consistent spacing around braces and parameters
```cpp
// Preferred - consistent spacing
const NATSConnectionPtr & getConnection() { return connection; }
const std::vector
& getSubjects() const { return subjects; }
// Avoid - inconsistent spacing
const NATSConnectionPtr & getConnection(){return connection;}
const String & getQueueName() const{return queue_name;}
2. **Comments**: Use triple slashes (///) for single-line comments instead of double slashes (//)
```cpp
/// Implements `instrumentation` system table, which allows you to get information about functions instrumented by XRay.
// Avoid: // Get a vector of indices.
- Pointer and reference formatting: Add spaces around
*and&operators ```cpp // Preferred std::vectorgetIndices(const GinFilter * filter, const PostingsCacheForStore * cache_store) const;
// Avoid
std::vector
- Type naming: Follow project conventions (e.g.,
UInt32instead ofuint32_tin ClickHouse codebase)
Consistent formatting reduces cognitive load during code reviews and makes the codebase more professional and maintainable.