소스 정보
- 저장소
- apache/doris
- 최근 소스 활동
- 2026년 4월 10일 06:59
- 감지된 SKILL.md 언어
- 영어
- 스타
- 15,796
- 포크
- 3,913
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
SOC 직업 분류 기준
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/apache/doris --skill clang-tidy-check명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
| name | clang-tidy-check |
| description | Run clang-tidy on newly added/modified BE C++ code |
| compatibility | opencode |
Run clang-tidy static analysis on newly added or modified C++ files in the BE and Cloud modules, using the project's .clang-tidy configuration. The script parses git diff to identify changed line ranges and filters clang-tidy output to diagnostics on those lines where possible, reducing noise from pre-existing code. Diagnostics from included headers that were not part of the diff are filtered out, though some edge cases may still appear.
compile_commands.json generated during the CMake build. For BE files, build BE; for Cloud files, build Cloud.For BE files:
./build.sh --be -j${DORIS_PARALLELISM}
This generates compile_commands.json in be/build_Release/ or be/build_ASAN/.
For Cloud files:
./build.sh --cloud -j${DORIS_PARALLELISM}
This generates compile_commands.json in cloud/build_Release/ or cloud/build_ASAN/.
Note: A single compilation database typically covers only one module (BE or Cloud). If your changes span both modules, you may need to run clang-tidy twice with different --build-dir values.
build-support/run-clang-tidy.sh
By default, this script:
git diff (uncommitted changes + staged changes)compile_commands.json from the latest BE build.clang-tidy configOptions:
# Compare against a specific branch (e.g., for PR review)
build-support/run-clang-tidy.sh --base origin/master
# Check specific files (all lines, no line-level filtering)
build-support/run-clang-tidy.sh --files be/src/vec/functions/my_new_func.cpp
# Report ALL warnings in changed files (no line filtering)
build-support/run-clang-tidy.sh --full
# Specify build directory explicitly (required for Cloud if BE build dir was auto-detected)
build-support/run-clang-tidy.sh --build-dir be/build_ASAN
# Check Cloud files with Cloud compilation database
build-support/run-clang-tidy.sh --build-dir cloud/build_ASAN
# Apply auto-fixes where possible (note: fixes may apply beyond changed lines)
build-support/run-clang-tidy.sh --fix
Important: By default, only warnings on changed lines are reported (diagnostics from headers not in the diff are filtered out). This prevents the agent from "fixing" unrelated pre-existing warnings in large files. Use --full to see all warnings if needed.
clang-tidy output looks like:
be/src/vec/functions/foo.cpp:42:5: warning: use auto when initializing with a cast [modernize-use-auto]
be/src/vec/functions/foo.cpp:55:1: warning: function 'process' exceeds recommended size [readability-function-size]
Fix approach:
// NOLINT(check-name) with a brief justificationRe-run the script to confirm all warnings are resolved:
build-support/run-clang-tidy.sh
.clang-tidy)| Category | Examples |
|---|---|
clang-diagnostic-* | Compiler diagnostics |
clang-analyzer-* | Static analysis (null deref, use-after-free, etc.) |
bugprone-* | Use-after-move, redundant branch condition, unused RAII |
modernize-* | Auto, range-for, nullptr (excludes trailing return, nodiscard) |
readability-* | Function size (≤80 lines), cognitive complexity (≤50) |
performance-* | String find, inefficient algorithm, move-const-arg |
misc-redundant-expression | Redundant expressions |
Files in these paths are automatically skipped:
be/src/apache-orc/, be/src/clucene/, be/src/gutil/be/src/glibc-compatibility/contrib/ (all third-party code)When a clang-tidy warning cannot be fixed, suppress it with a comment:
// Good: specific check name + reason
int x = (int)y; // NOLINT(modernize-use-auto): explicit cast for clarity
// Bad: blanket suppression without reason
int x = (int)y; // NOLINT
| Problem | Solution |
|---|---|
compile_commands.json not found | Build BE first: ./build.sh --be -j${DORIS_PARALLELISM} |
clang-tidy not found | Install via LDB toolchain or apt install clang-tidy-16 |
| Too many warnings on old code | Use --base to diff against a branch, ensuring only your changes are checked |
| Warning in header included by your file | Only fix if the header is also in your changeset; otherwise note it in your report |