Skip to content
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

有关RTT的编程风格 #1913

Open
LittleFatHero opened this issue Oct 20, 2018 · 6 comments

Comments

@LittleFatHero
Copy link

commented Oct 20, 2018

首先,感觉"!"、 "~"、 "++"、 "--"、 "&"(地址操作符)等单目操作符前后不应该加空格
其次,switch语句和case语句位于同一列,没有缩进让我很难受

@BernardXiong

This comment has been minimized.

Copy link
Member

commented Oct 27, 2018

嗯,可以看看tools下的astyle脚本。

@ShareCat

This comment has been minimized.

Copy link

commented Oct 31, 2018

为什么有些源码大括号换行,有些大括号不换行,强迫症。。。

tools目录下没有看到astyle脚本。。

@ShareCat

This comment has been minimized.

Copy link

commented Oct 31, 2018

astyle脚本找到了:as.sh

建议所有大括号换行,除了函数的大括号外

@liruncong

This comment has been minimized.

Copy link

commented Nov 5, 2018

我倒是认为, 应该除函数的大括号外,都不换行. 这样一个文件可以少很多行, 比较简洁.

@BernardXiong

This comment has been minimized.

Copy link
Member

commented Nov 6, 2018

RTT的风格是相互之间错开,清晰些

@gbcwbz

This comment has been minimized.

Copy link
Contributor

commented Dec 24, 2018

zephyr 在根目录包括了一个 .clang-format 文件, rtt 也可以加个 astylerc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.