【发布时间】:2019-02-26 07:03:50
【问题描述】:
运行 uncrustify 后,我希望行的长度不超过 80 个字符。如何在 uncrustify 配置文件中设置行的最大长度?
【问题讨论】:
标签: code-formatting uncrustify
运行 uncrustify 后,我希望行的长度不超过 80 个字符。如何在 uncrustify 配置文件中设置行的最大长度?
【问题讨论】:
标签: code-formatting 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.
【讨论】:
for 和函数只有在超过code_width 设置的限制时才会发生,对吧?如果不是,设置,他们什么都不做?另外,可以配置拆分它们的方式吗?我知道这取决于所坚持的风格。