问题标签 [uncrustify]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
504 浏览

c++ - 使用 uncrustify 进行公共、私人、信号等指示?

在 uncrustify 的配置中,我可以在哪里找到publicQt和缩进?例如要改变这个:privateprotectedslotssignals

...对此:

?

0 投票
1 回答
179 浏览

c++ - Uncrustify:初始化列表:以逗号开头

我想通过 Uncrustify 自动归档以下代码结构:

我试过 Uncrustify 版本:0.63:

但它不起作用。我应该设置什么来获得类似上面的代码?

0 投票
0 回答
102 浏览

uncrustify - C++11 成员初始化器列表

我想知道是否可以将 uncrustify 配置为格式化 C++11 成员初始化列表。例如:

uncrustify 似乎认为 m_client_factory 初始化是一个函数,这不好,因为它会导致格式不正确。这可以做到吗?

0 投票
0 回答
337 浏览

c - 如何更改 Uncrustify 配置以将变量名称缩进与函数名称相同的列?

在我的学校中,我们使用编码约定,它指定将变量的名称及其类型(在 C 中)分开。在 emacs 中,它看起来像这样:

另一个约定是尽可能使用制表,因此这里在 var/functions 类型和名称之间存在制表符。我实际上想从 emacs 切换到 atom 编辑器。我尝试在 uncrustify 中使用很多选项来格式化我的代码,但我仍然找不到这样做的方法:用函数名缩进 var 名称......我得到的只是能够指定一个类型和名称之间的“绝对”列数,带有align_var_def_gap选项,但它是绝对的,并且如果函数名称(此处为“calc_dir”)不适合,假设是 1 制表后...

如果有人有配置或想法,那就太好了!

0 投票
1 回答
100 浏览

uncrustify - 如何让 Uncrustify 缩进点续行?

我如何配置Uncrustify来格式化:

像这样:

谢谢。

0 投票
1 回答
971 浏览

uncrustify - Uncrustify - 如何按两个空格对齐尾随评论?

在我使用 Uncrustify 在我的代码上应用 Atom Beautify 后,尾随注释对齐如下:

分号和尾随注释之间只有一次空格,但我希望它们之间至少有 2 个空格。我正在使用Atom 1.12.9Atom Beautify 0.29.16Uncrustify 0.64。这是我的 Uncrustify 配置

有什么办法可以增加差距吗?我已经定了align_right_cmt_span = 4,但没有希望。提前致谢。

0 投票
2 回答
4035 浏览

configuration - 如何在可视化代码中配置 uncrustify?

我已经在我的 linux 机器上安装了 uncrustify,并且在 Visual Code 中也安装了它的扩展。我已将 settings.json 配置如下:

并在 keybiddings.json 中添加了这一行:

当我点击“ctrl+f6”时,它说没有找到 uncrustify 命令,即使通过终端访问/usr/bin/uncrustify我得到了 uncrustify 二进制文件。

0 投票
1 回答
1042 浏览

java - java - 如何在使用uncrustify格式化程序的java lambda表达式之后正确缩进?

我正在使用带有 atom-beautify 和 uncrustify 的 atom 来格式化我的 java 文件。我希望 lambda 表达式的缩进只在左大括号后缩进一级,() -> {. 我尝试过调整indent_continue属性,但是当我将其设置为零时它变得疯狂。(使用 4 个空格进行缩进)

indent_continue = 0,会发生这种情况:

indent_continue = 4,它会加倍缩进:

期望的结果:

当前的 uncrustify.cfg

版本信息:

0 投票
1 回答
176 浏览

c++ - 如何使用 Uncrustify 重置代码格式

我正在使用Uncrustify来格式化我的 C++ 代码,并且我正在使用无限的设置列表进行一些实验。

由于一些错误的设置,我的代码现在有很多新行,将语句拆分为更多行(主要是由于行宽较短)。

我想重新格式化代码,以便每行有一个语句并以另一种方式重新格式化。

我该怎么做?

0 投票
1 回答
1658 浏览

atom-editor - uncrustify google style c++ config

I am using uncrustify and atom-beautify in atom.io to format my C++ code according to google styling guide. I am using CPPlint to verify whether the code is formatted correctly. I am using the config file from https://gist.githubusercontent.com/philectron/1a1e1ccb06d5643cd61d85fc5ecaf429/raw/8813567b8f7dd49003228e19c3d10719b49995a1/uncrustify-preferences.cfg. But after beautifying, cpplint is reporting the following problems.

  1. "At least two spaces is best between code and comments [whitespace/comments]" is not enforced and I am getting this error in multiple places. The answer for this question at Uncrustify - How do I align trailing comments by two-space gap? is not working.
  2. "protected: should be indented +1 space inside." I am getting the same error for private and public as well.

If this is not the right way, how can I beautify and lint inside atom.io.