code-formatting - uncrustify:如何设置最大线长度

标签 code-formatting uncrustify

运行 uncrustify 后,我不希望任何行长度超过 80 个字符。如何设置 uncrustify 配置文件中的最大行长度?

最佳答案

将这样的部分添加到您的配置文件中。它不保证获得低于指定宽度的所有行。

#
# Line Splitting options
#

code_width            80            
# Unsigned Number
# Try to limit code width to N number of columns

ls_for_split_full     True  
# { False, True }
# Whether to fully split long 'for' statements at semi-colons.

ls_func_split_full    True
# { False, True }
# Whether to fully split long function protos/calls at commas.

ls_code_width         True
# { False, True }
# Whether to split lines as close to code_width as possible and ignore some groupings.

关于code-formatting - uncrustify:如何设置最大线长度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52451024/

相关文章:

git - 重建 git 历史记录的脚本,对每个版本应用代码清理

ctags 多行 C 函数原型(prototype)

c++ - 使用 Uncrustify 格式化构造函数成员初始化

c++ - 使用 Uncrustify 完全拆分长函数定义,不仅在逗号处

python - if block 中的语句后出现意外标记 '<newline>'

fonts - Sublime Text 2 中每个 token 的字体大小

java - Eclipse Java 格式化程序 : blank lines

c++ - Uncrustify 在 Class::method 处破坏代码

objective-c - Uncrustify 可以在 Objective-C 方法调用中对齐冒号吗?

c++ - 如何在 Visual Studio Code 中修改 C++ 的代码格式?