본문으로 건너뛰기
cccskills
무료GitHub에 공개

be-code-style

Format C++ code in the BE and Cloud modules using the project's clang-format v16 rules. Use the provided scripts to fix formatting or check for violations without changing files, then review the resulting differences before committing.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Fix BE (C++) code formatting issues using clang-format

설치 방법 보기

이럴 때 유용합니다

  • Format BE or Cloud C++ code before committing
  • Fix formatting failures reported by CI
  • Check formatting without modifying files
  • Find the required clang-format v16 executable

포함된 파일(1)

  • SKILL.md2.8 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

What I do

Fix C++ code formatting issues in the BE and Cloud modules using the project's clang-format configuration (v16).

When to use me

  • Before committing BE/Cloud C++ code changes
  • When CI reports clang-format failures
  • When you need to check or fix C++ code style

Prerequisites

You need to confirm that the major version of the called clang-format is 16. If the current environment's default does not meet this requirement, try the following:

  1. If .vscode/settings.json exists, use the clang-format.executable item in it.
  2. If it is a worktree directory, use the .vscode/settings.json from the main directory.
  3. Check the path to the compiler toolchain by trying to find it from the PATH environment variable, the current directory, and the main directory's custom_env.sh. Look for a clang-format with the major version number 16 in that path and its parent directory.

Procedure

Step 1: Auto-fix formatting

Run the project's formatting script, which enforces clang-format v16:

build-support/clang-format.sh

This formats all C++ files under be/src, be/test, cloud/src, cloud/test in-place, respecting .clang-format and .clang-format-ignore.

Important: Always use this script instead of invoking clang-format directly. The script checks that clang-format version 16 is installed and exits with an error if the wrong version is found. Using a different version will produce inconsistent formatting.

Step 2: Check-only (no modification)

To verify formatting without modifying files:

build-support/check-format.sh

This outputs a diff of any formatting violations and exits non-zero if there are any.

Step 3: Review and commit

After running clang-format.sh, review the changes with git diff to verify only formatting was changed, then stage and commit.

Key Configuration

FilePurpose
.clang-formatMain formatting rules (Google-based, 100 col, 4-space indent)
.clang-format-ignoreFiles excluded from formatting (third-party, generated)
build-support/run_clang_format.pyPython wrapper for parallel execution

Excluded Directories

The following are excluded from formatting (see .clang-format-ignore):

  • be/src/apache-orc/*, be/src/clucene/*, be/src/gutil/*
  • be/src/glibc-compatibility/*
  • Specific third-party vendored files (mustache, sse2neon, utf8_check)
  • cloud/src/common/defer.h

Troubleshooting

ProblemSolution
clang-format not foundInstall clang-format v16 or set CLANG_FORMAT_BINARY env var
version is not 16Install clang-format v16; on macOS: brew install llvm@16
Files not being formattedCheck .clang-format-ignore for exclusions

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Run clang-tidy static analysis, which checks code without executing it, on added or modified BE and Cloud C++ files. Focus diagnostics on changed lines, investigate bug, performance, and readability warnings, and verify fixes with another check.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Check changed C++ code before committing
  • Investigate clang-tidy warnings reported by CI
  • Review changes against a specific branch
apache/doris1.6만2026년 10월 18일 업데이트

Review Doris code changes using project-specific checklists for data correctness, concurrency, memory safety, compatibility, performance, and tests. Trace related code paths and explain findings with concrete failure scenarios, using query plan trees when reviewing optimizer behavior.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Review newly completed Doris code changes
  • Check concurrency and memory management in related code paths
  • Assess compatibility and test coverage before merging
apache/doris1.6만2026년 10월 18일 업데이트

Prepare a clean Doris package and run Docker regression tests, which check whether changes break existing behavior. Restore configuration and startup files from Git, build the test image, and investigate failures using configuration checks and runtime logs.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Run Docker regression tests before submitting Doris changes
  • Test without local configuration changes affecting results
  • Investigate missing test suites or startup failures
apache/doris1.6만2026년 10월 18일 업데이트

Diagnoses and fixes Java style violations in the FE module using Checkstyle, a tool that checks coding rules. It interprets errors, applies the project's formatting and import restrictions, and reruns checks to verify fixes.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Checking FE Java changes before committing
  • Fixing build failures caused by Checkstyle violations
  • Understanding project-specific style and import rules
apache/doris1.6만2026년 10월 18일 업데이트

apache의 스킬 모두 보기

이 스킬의 문제 신고