uncrustify

Ensure coding-style during a git commit [closed]

ぃ、小莉子 提交于 2019-12-03 14:26:21
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. Im my company i set-up a continuous integration test and i run the tests when someone push the code on the server. Now i want to check that the code match with the our basic coding rules, the first rule is "run mogrify on your code!" There is something to do this check "out the shelf"? the output of this analisys can be stored on a file or something else. thanks I would suggest using a lint like tool, e.g. for ObjectC

Can Uncrustify be prevented from modifying certain sections of code?

若如初见. 提交于 2019-12-03 11:41:01
问题 Uncrustify is great, and does an excellent job of tidying code. However, I have some C code within a file that I don't want Uncrustify to change. Is there any way I can prevent Uncrustify from touching this, maybe by putting specific tags in comments around the code or something? 回答1: /* *INDENT-OFF* */ int i = 0; // No uncrustify action here /* *INDENT-ON* */ 来源: https://stackoverflow.com/questions/15097501/can-uncrustify-be-prevented-from-modifying-certain-sections-of-code

Using Uncrustify with VIM

时间秒杀一切 提交于 2019-12-03 09:06:29
问题 In my vimrc I call Uncrustify by this command: %!uncrustify -l CPP -c D:\uncrustify\default.cfg After that on some code I get a Windows Fatal error: But when I call uncrustify on the same code in the console using the -f option, there is no error. How can I change my vimrc to avoid such errors in the future? What can invoke this error? 回答1: In order to integrate Uncrustify with Vim properly, add the following to your .vimrc : " Restore cursor position, window position, and last search after

ctags multi-line C function prototypes

别来无恙 提交于 2019-12-03 06:14:11
Is there a way for ctags to handle multiline function prototypes in C? I've searched around and the --fields=+S is supposed to do multiline prototypes, but I can't get it to work: ctags -x --c-kinds=pf --fields=+S file file: int foo(int x, int y ); ctags only returns: foo(int (Note that the return type is also missing) Ultimately I would like to get an output similar to int foo(int x, int y); or int foo(int x, int y is --fields=+S not the correct way? Are there part of the ctags fields that I am missing? Any pointers in general? If there is not a way to do it in ctags, any recommended programs

Using Uncrustify with VIM

微笑、不失礼 提交于 2019-12-02 23:17:45
In my vimrc I call Uncrustify by this command: %!uncrustify -l CPP -c D:\uncrustify\default.cfg After that on some code I get a Windows Fatal error: But when I call uncrustify on the same code in the console using the -f option, there is no error. How can I change my vimrc to avoid such errors in the future? What can invoke this error? In order to integrate Uncrustify with Vim properly, add the following to your .vimrc : " Restore cursor position, window position, and last search after running a " command. function! Preserve(command) " Save the last search. let search = @/ " Save the current

Can Uncrustify align colons in Objective-C method calls?

橙三吉。 提交于 2019-11-28 05:59:55
I am using uncrustify 0.52. When I run it against Objective-C files, it wants to convert method invocations like this: [NSApp beginSheet:startTimerDialog modalForWindow:nil modalDelegate:nil didEndSelector:nil contextInfo:nil]; to this: [NSApp beginSheet:startTimerDialog modalForWindow:nil modalDelegate:nil didEndSelector:nil contextInfo:nil]; I prefer the first version, with the colons aligned. Is there an option in the uncrustify config file that can support what I want, or does uncrustify just not support aligned colons? If uncrustify can't align the colons, is there a way to prevent it

Can Uncrustify align colons in Objective-C method calls?

淺唱寂寞╮ 提交于 2019-11-27 05:37:28
问题 I am using uncrustify 0.52. When I run it against Objective-C files, it wants to convert method invocations like this: [NSApp beginSheet:startTimerDialog modalForWindow:nil modalDelegate:nil didEndSelector:nil contextInfo:nil]; to this: [NSApp beginSheet:startTimerDialog modalForWindow:nil modalDelegate:nil didEndSelector:nil contextInfo:nil]; I prefer the first version, with the colons aligned. Is there an option in the uncrustify config file that can support what I want, or does uncrustify