build(format): 加入 clang-format 配置
This commit is contained in:
1 parent
ef128e6776
commit
7723c5d83a
6 files changed
+77
No files matched your search
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
# 基座:Google C++ Style Guide;仅覆盖团队约定的两项(4 空格 / 100 列)
|
||||||
|
# clang-format 没有独立的 C 语言段,.c/.h 统一按 Language: Cpp 处理
|
||||||
|
Language: Cpp
|
||||||
|
BasedOnStyle: Google
|
||||||
|
|
||||||
|
IndentWidth: 4
|
||||||
|
TabWidth: 4
|
||||||
|
ColumnLimit: 100
|
||||||
|
|
||||||
|
# 只格式化自写代码:Core/、Drivers/、Middlewares/ 下各有一个 DisableFormat 版本
|
||||||
Vendored
+37
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Simba-Titan",
|
||||||
|
"compilerPath": "C:/Users/Guanxi/AppData/Local/Keil_v5/ARM/ARMCLANG/bin/armclang.exe",
|
||||||
|
"compilerArgs": [
|
||||||
|
"--target=arm-arm-none-eabi",
|
||||||
|
"-mcpu=cortex-m7",
|
||||||
|
"-mfpu=fpv5-d16",
|
||||||
|
"-mfloat-abi=hard"
|
||||||
|
],
|
||||||
|
"intelliSenseMode": "windows-clang-arm",
|
||||||
|
"cStandard": "c11",
|
||||||
|
"cppStandard": "c++17",
|
||||||
|
"includePath": [
|
||||||
|
"${workspaceFolder}/Core/Inc",
|
||||||
|
"${workspaceFolder}/Drivers/STM32H7xx_HAL_Driver/Inc",
|
||||||
|
"${workspaceFolder}/Drivers/STM32H7xx_HAL_Driver/Inc/Legacy",
|
||||||
|
"${workspaceFolder}/Drivers/CMSIS/Device/ST/STM32H7xx/Include",
|
||||||
|
"${workspaceFolder}/Drivers/CMSIS/Include",
|
||||||
|
"${workspaceFolder}/Drivers/CMSIS/RTOS2/Include",
|
||||||
|
"${workspaceFolder}/Middlewares/Third_Party/FreeRTOS/Source/include",
|
||||||
|
"${workspaceFolder}/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2",
|
||||||
|
"${workspaceFolder}/Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F",
|
||||||
|
"${workspaceFolder}/Middlewares/ST/ARM/DSP/Inc"
|
||||||
|
],
|
||||||
|
"defines": [
|
||||||
|
"USE_PWR_LDO_SUPPLY",
|
||||||
|
"USE_HAL_DRIVER",
|
||||||
|
"STM32H723xx",
|
||||||
|
"ARM_MATH_CM7",
|
||||||
|
"__FPU_PRESENT=1U"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": 4
|
||||||
|
}
|
||||||
Vendored
+14
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"C_Cpp.formatting": "clangFormat",
|
||||||
|
"C_Cpp.clang_format_style": "file",
|
||||||
|
"C_Cpp.clang_format_fallbackStyle": "Google",
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.formatOnSaveMode": "modificationsIfAvailable",
|
||||||
|
"editor.defaultFormatter": "ms-vscode.cpptools",
|
||||||
|
"[c]": {
|
||||||
|
"editor.defaultFormatter": "ms-vscode.cpptools"
|
||||||
|
},
|
||||||
|
"files.associations": {
|
||||||
|
"*.h": "c"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
# CubeMX 生成目录:禁止自动格式化(每次 GENERATE 会被重写,格式化只产生无意义 diff)
|
||||||
|
Language: Cpp
|
||||||
|
DisableFormat: true
|
||||||
|
SortIncludes: Never
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
# ST HAL / CMSIS:第三方代码,保持原样便于与官方版本对比
|
||||||
|
Language: Cpp
|
||||||
|
DisableFormat: true
|
||||||
|
SortIncludes: Never
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
# FreeRTOS / CMSIS-DSP 等中间件:第三方代码,禁止自动格式化
|
||||||
|
Language: Cpp
|
||||||
|
DisableFormat: true
|
||||||
|
SortIncludes: Never
|
||||||
Reference in new issue
Block a user