In order to cooperate with Doris's successful graduation from Apache, the Doris official website also needs a new look and more powerful feature, so we decided to redesign the Doris official website. The code and documents of the new official website are included in this PR. Since the new website is completely rewritten, the content and structure of the project are different from the previous one. In particular, the directory structure of documents has changed, and the number of documents is large, so the number of files in this PR is very large. In the old website,all English documents are in the en/ directory, and Chinese documents in the zh-CN/ directory, but in the new website,the documents are split into multiple directories according to the nav. The document's directory structure changes as follows: ``` docs (old website) | |—— .vuepress (library) | |—— en | | |—— admin-manual │ │ |—— advanced | | |—— article | | |—— benchmark | | |—— case-user | | |—— community | | |—— data-operate | | |—— data-table | | |—— design | | |—— developer-guide | | |—— downloads | | |—— ecosystem | | |—— faq | | |—— get-starting | | |—— install | | |—— sql-manual | | |—— summary | | |___ README.md | |—— zh-CN ... docs (new website) | |—— .vuepress (library) | |—— en | | |—— community (unchanged, community nav) │ │ |—— developer (new directory, developer nav) │ │ | |—— design (moved from en/design) │ │ | |__ developer-guide (moved from en/developer-guide) | | |—— docs (new directory, all children directories moved from en/, document nav) │ │ | |—— admin-manual │ │ | |—— advanced │ │ | |—— benchmark │ │ | |—— data-operate │ │ | |—— data-table │ │ | |—— ecosystem │ │ | |—— faq │ │ | |—— get-starting │ │ | |—— install │ │ | |—— sql-manual │ │ | |—— summary | | |—— downloads (unchanged, downloads nav) | | |—— userCase (moved from en/case-user, user nav) | | |___ README.md | |—— zh-CN ... ```
2.2 KiB
2.2 KiB
title, language
| title | language |
|---|---|
| C++ 代码分析 | zh-CN |
C++ 代码分析
Doris支持使用Clangd和Clang-Tidy进行代码静态分析。Clangd和Clang-Tidy在LDB-toolchain中已经内置,另外也可以自己安装或者编译。
Clang-Tidy
Clang-Tidy中可以做一些代码分析的配置,配置文件.clang-tidy在Doris根目录下。
在VSCODE中配置Clangd
首先需要安装clangd插件,然后在settings.json中编辑或者直接在首选项中更改插件配置。相比于vscode-cpptools,clangd可以为vscode提供更强大和准确的代码转跳,并且集成了clang-tidy的分析和快速修复功能。
"clangd.path": "ldb_toolchain/bin/clangd", //clangd的路径
"clangd.arguments": [
"--background-index",
"--clang-tidy", //开启clang-tidy
"--compile-commands-dir=doris/be/build_RELEASE/", //会用到cmake生成的compile_commands.json,所以需要先编译一次生成该文件
"--completion-style=detailed",
"-j=5", //clangd分析文件的并行数
"--all-scopes-completion",
"--pch-storage=memory",
"--pretty",
"-log=verbose",
"--query-driver=ldb_toolchain/bin/*" //编译器路径
],
"clangd.trace": "/home/disk2/pxl/dev/baidu/bdg/doris/core/output/clangd-server.log" //clangd的日志路径,可以自己设定