跳到正文

个人记录

代码格式化

wangzhifang约 1 分钟
原文
文章信息与版本

文章信息

发布
2021年12月12日
收录
2025年12月12日
更新
2026年11月10日
篇幅
约 1 分钟
获赞
1

版本

  1. v1当前

Astyle\texttt{Astyle} 指令:--style=java --indent=force-tab-x=4 --attach-namespaces --attach-classes --attach-inlines --attach-extern-c --attach-closing-while --indent-classes --indent-switches --indent-namespaces --indent-continuation=0 --indent-labels --indent-preproc-define --unpad-paren --delete-empty-lines --align-pointer=type --break-closing-braces --break-elseifs --break-one-line-headers --remove-braces --attach-return-type --remove-comment-prefix --lineend=linux。

空格:

  1. 必要行内分隔;
  2. 说明符 operator 后;
  3. 非行末分号(常见于 if,switch,for 语句中)后;
  4. new[] 及 delete[] 后的处理方式同 new 及 delete。

特殊情况:

  1. 不利用返回值的逗号运算符缩进时视为分号运算符。
原文