Skip to content

新增clang-format对代码进行格式管控 #341

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tju-wang
Copy link

-文件.clang-format配置基于Google C++风格指南,并做了适当调整
1.使用4空格缩进
2.行宽限制为100字符
3.采用风格的大括号和空格规则

-编写code_style.m
1.针对不同开发平台(windows/Linux/macOs)
2.举例进行整体项目格式化(建议owner择机进行)
3.举例单文件格式化、格式检查
4.举例如何跳过特定代码段的格式化(待补充指定跳过文件格式化)
5.IDE集成说明

-文件.clang-format配置基于Google C++风格指南,并做了适当调整
1.使用4空格缩进
2.行宽限制为100字符
3.采用风格的大括号和空格规则

-编写code_style.m
1.针对不同开发平台(windows/Linux/macOs)
2.举例进行整体项目格式化(建议owner择机进行)
3.举例单文件格式化、格式检查
4.举例如何跳过特定代码段的格式化(待补充指定跳过文件格式化)
5.IDE集成说明
@tju-wang
Copy link
Author

虾哥,为项目新增clang-format代码格式检查工具,您先帮忙review下初版,同步验证下工具效果。我会继续完善使用案例
@78 Xiaoxia @78

@78
Copy link
Owner

78 commented Mar 13, 2025

这里如何做到,提交PR的代码如果不符合要求,提示调整? 当前项目不符合要求的代码,是否需要先统一调整?

@tju-wang
Copy link
Author

第一个问题我再研究下
第二个问题,我来修改patch,让整体项目主要代码符合clang-format格式

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants