| 静态检查能力增强 Co-authored-by: hejianping<hejianping7@huawei.com> # message auto-generated for no-merge-commit merge: !346 merge br_pre_commit_config into dev 静态检查能力增强 Created-by: hejianping Commit-by: hejianping Merged-by: ascend-robot Description: # 合入背景 目前在MindIE-LLM社区中,没有部署个人级静态检查工具,很多开发过程中存在的低级错误,依赖Committer的代码检视无法完全看护,亟需进行静态检查能力增强,本PR合入关联issue:Fixs [#186](https://gitcode.com/Ascend/MindIE-LLM/issues/186) # 修改内容 参考主流开源社区,部署pre-commit检查工具,进行静态检查,开发人员在本地实现pre-commit工具部署,代码提交前,完成代码规范化检查 # 资料变更 不涉及 # 接口变更 不涉及 # 测试结果 不涉及 # CheckList - [x] 代码注释完备 - [x] 正确记录错误日志 - [x] 进行了返回值校验 (禁止使用void屏蔽安全函数、自研函数返回值;考虑接口的异常场景;调用底层组件接口时,需要进行返回值校验) - [x] 进行了空指针校验 - [x] 若存在资源申请,使用后资源被正确的释放了 - [x] 若涉及多线程场景,考虑了并发场景,不存在死锁问题 - [x] 按照[代码仓中提供的格式模板](https://gitcode.com/Ascend/MindIE-LLM/blob/master/.clang-format),使用clang-format工具格式化代码 - [x] 符合Ascend社区的编码规范。[C++ 语言编程指导](https://gitcode.com/Ascend/community/blob/master/docs/contributor/Ascend-cpp-coding-style-guide.md) | [C++ 语言安全编程指导](https://gitcode.com/Ascend/community/blob/master/docs/contributor/Ascend-cpp-secure-coding-guide.md) See merge request: Ascend/MindIE-LLM!346 | 6 个月前 |