cpp-naming-check

โดย clickhouse

Check C++ naming conventions against Google Style Guide. Use when checking if names follow conventions or when renaming identifiers.

npx skills add https://github.com/clickhouse/pg_stat_ch --skill cpp-naming-check

C++ Naming Convention Checker

Verify names follow Google C++ Style Guide conventions.

Naming Rules Quick Check

EntityConventionPatternExamples
Fileslowercase + _ or -snake_case.ccmy_class.cc, http-parser.h
ClassesPascalCase[A-Z][a-zA-Z0-9]*MyClass, UrlParser
StructsPascalCase[A-Z][a-zA-Z0-9]*Point, HttpRequest
Type aliasesPascalCase[A-Z][a-zA-Z0-9]*DataMap, StringList
EnumsPascalCase[A-Z][a-zA-Z0-9]*ErrorCode, State
EnumeratorskPascalCasek[A-Z][a-zA-Z0-9]*kOk, kNotFound
FunctionsPascalCase[A-Z][a-zA-Z0-9]*ProcessData(), GetValue()
Accessorssnake_case[a-z][a-z0-9_]*count(), set_count()
Variablessnake_case[a-z][a-z0-9_]*table_name, num_items
Class memberssnake_case_[a-z][a-z0-9_]*_value_, data_map_
Struct memberssnake_case[a-z][a-z0-9_]*width, height
ConstantskPascalCasek[A-Z][a-zA-Z0-9]*kMaxSize, kPi
MacrosUPPER_CASE[A-Z][A-Z0-9_]*MY_MACRO, DEBUG_LOG
Namespacessnake_case[a-z][a-z0-9_]*my_project, internal
Template paramsVariesType=T, value=nT, InputIterator, N

Common Mistakes

❌ Wrong → ✅ Correct

// Classes
class myClass;        → class MyClass;
class HTTPParser;     → class HttpParser;  // Treat acronyms as words

// Variables
int TableName;        → int table_name;
int tablename;        → int table_name;    // Use underscores

// Class members
int value;            → int value_;        // Trailing underscore
int m_value;          → int value_;        // No Hungarian notation

// Functions
void process_data();  → void ProcessData();
void getValue();      → void GetValue();   // Or get_value() if accessor

// Constants
const int MAX_SIZE;   → const int kMaxSize;
const int maxSize;    → const int kMaxSize;

// Enumerators
enum { ERROR_OK };    → enum { kErrorOk };
enum { Ok };          → enum { kOk };

// Macros (must be UPPER_CASE with prefix)
#define DEBUG         → #define MYPROJECT_DEBUG

Abbreviations

  • OK: Listed in Wikipedia or universally known (i, n, id, url)
  • Capitalize as word: StartRpc() not StartRPC()
  • Don't delete letters: customer not cstmr

Check Process

  1. Identify the entity type (class, function, variable, etc.)
  2. Apply the corresponding naming rule
  3. Check for consistency with surrounding code
  4. Flag any Hungarian notation or other outdated styles

Skills เพิ่มเติมจาก clickhouse

clickhouse-best-practices
clickhouse
กฎแนวปฏิบัติที่ดีที่สุดของ ClickHouse จำนวน 28 ข้อ จัดตามการออกแบบสคีมา การปรับแต่งคิวรี และกลยุทธ์การนำเข้าข้อมูล ครอบคลุมสามด้านสำคัญ: การเลือกคีย์หลักและชนิดข้อมูล (การตัดสินใจออกแบบที่ไม่สามารถเปลี่ยนแปลงได้), การปรับแต่ง JOIN และคิวรี, และการทำแบทช์อินเสิร์ตพร้อมหลีกเลี่ยงมิวเทชัน รวมถึงกฎ 28 ข้อที่จัดลำดับตามผลกระทบ โดยกฎการออกแบบสคีมาและการปรับแต่งคิวรีถูกทำเครื่องหมายว่าสำคัญมาก (CRITICAL) เนื่องจากกลไกการจัดเก็บแบบคอลัมน์และดัชนีแบบกระจัดกระจายของ ClickHouse มีขั้นตอนการตรวจสอบที่มีโครงสร้างสำหรับ...
official
clickhouse-js-node-coding
clickhouse
Write idiomatic application code with the ClickHouse Node.js client (`@clickhouse/client`). Use this skill whenever a user is *building* against the Node.js…
official
clickhousectl-cloud-deploy
clickhouse
ใช้เมื่อผู้ใช้ต้องการปรับใช้ ClickHouse ไปยังคลาวด์ ไปสู่ระบบผลิต ใช้ ClickHouse Cloud โฮสต์บริการ ClickHouse ที่มีการจัดการ หรือย้ายจากระบบภายในเครื่อง…
official
clickstack-otel-collector
clickhouse
Use when a user wants to wire an OpenTelemetry collector into a Managed ClickStack service on ClickHouse Cloud, either by deploying a new local collector…
official
infra-clickhouse
clickhouse
Sets up and manages ClickHouse using the clickhousectl CLI — installs and runs a local ClickHouse server for development, and creates managed ClickHouse Cloud…
official
infra-postgres
clickhouse
ตั้งค่าและจัดการ Postgres โดยใช้ clickhousectl CLI — รัน Postgres ที่ใช้ Docker ในเครื่องสำหรับการพัฒนา และสร้างและดำเนินการจัดการ ClickHouse ที่มีการจัดการ...
official
clickhouse-best-practices
clickhouse
ต้องใช้เมื่อตรวจสอบสคีมา คิวรี หรือการกำหนดค่าของ ClickHouse ประกอบด้วยกฎ 31 ข้อที่ต้องตรวจสอบก่อนให้คำแนะนำ ควรอ่านเสมอ…
official
setup
clickhouse
แนะนำผู้ใช้ในการตั้งค่าการเชื่อมต่อเซิร์ฟเวอร์ ClickHouse MCP ที่มาพร้อมกับปลั๊กอินนี้ ใช้เมื่อผู้ใช้ติดตั้งปลั๊กอินครั้งแรกหรือพบปัญหา…
official