新增代码规范检查钩子(规范V1.0 可机械校验项)并修复存量违规

新增 scripts/check_coding_standard.py + coding-standard 钩子(S1~S9:
头文件保护宏、文件头注释、宏大写、_t 后缀、switch default、
禁 strcpy/sprintf/goto/Tab、函数注释)
修复存量违规:NET_* 字节序宏大写化、net_fd_set 等类型加 _t 后缀、
net_inet_ntoa 的 sprintf 改 snprintf、补 4 处函数注释与 ui_task.c 文件头
docs/代码规范/pre-commit使用说明.md:新增 2.8 节,修正失效文档路径
This commit is contained in:
2026-09-01 15:41:25 +08:00
parent 07afb7b468
commit 2b66f96d01
12 changed files with 278 additions and 72 deletions
+1
View File
@@ -263,6 +263,7 @@ powershell -ExecutionPolicy Bypass -File test\run_boot_test.ps1
- 行尾空格 / 文件尾换行(自动修复)
- 大文件 / 冲突标记 / YAML 语法(拦截)
- **cppcheck 静态分析**:warning / performance / portability / style 四类,发现问题即拦截
- **代码规范检查**:头文件保护宏、命名(宏大写/`_t` 后缀)、函数注释、default 分支、禁用 strcpy/sprintf/goto/Tab 等(规范 V1.0 可机械校验项)
- U+FFFD 乱码(拦截,不可逆损坏)
- commit message 格式(gitlint,拦截)