Questions tagged [uncrustify]

Source Code Beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and VALA

Uncrustify is an open source project, with a goal to create a highly configurable, easily modifiable source code beautifier.

Features :

  • Ident code, aligning on parens, assignments, etc
  • Align on '=' and variable definitions
  • Align structure initializers
  • Align #define stuff
  • Align backslash-newline stuff
  • Reformat comments (a little bit)
  • Fix inter-character spacing
  • Add or remove parens on return statements
  • Add or remove braces on single-statement if/do/while/for statements
  • Supports embedded SQL 'EXEC SQL' stuff
  • Highly configurable - 515 configurable options as of version 0.63
144 questions
4
votes
1 answer

Uncrustify split function call parameters

I want to format the code like this: a) line width maximum 120 b)- function call parameters one per line with indent if the length of the function is called is > 120 else function call in one line c)- it the function call is inside a if, for,…
mtb
  • 1,350
  • 16
  • 32
4
votes
1 answer

Uncrustify obj-c: Newline before and after call to super, interface declaration and implementation declaration

How can I add newline after call to super with uncrustify Current: - (void)someFunction { [super someFunction]; more stuff; and more stuff; } Desired: - (void)someFunction { [super someFunction]; more stuff; and more…
Luda
  • 7,282
  • 12
  • 79
  • 139
4
votes
0 answers

C++ / Uncrustify / Aligning base class specifications

I am trying to configure Uncrustify to align the base classes to get comma under the colon: class MyClass : public Base1 , public Base2 , public Base3 The only output I can get is this: class MyClass : public Base1 …
Maf
  • 491
  • 3
  • 5
4
votes
1 answer

uncrustify: getting rid of "comment after function of size" (mod_add_long_function_closebrace_comment)

I ran uncrustify with "comment after function of size" set to a very small value. Now practically every function has a comment like this: -(void) createBackgroundGradient { ... } /* createBackgroundGradient */ I can't seem to find a way to…
CodeSmile
  • 64,284
  • 20
  • 132
  • 217
4
votes
1 answer

Uncrustify breaking code at Class::method

I am trying to use Uncrustify but all configurations are breaking my code when working in xcode std::vector a; becomes std: : vector a; Is there a way to prevent this so that the :: is held together
JamHam
  • 93
  • 1
  • 7
4
votes
2 answers

Fully split long function definitions not only at commas using Uncrustify

I'm using Uncrustify v0.60 to format my C++ source code. In order to configure Uncrustify I am using the UniversalIndentGUI v1.2.0 rev.1070. In the Line Splitting options section of UniversalIndentGUI I have set Code Width to 120. Assume I have the…
Manuzor
  • 1,746
  • 1
  • 18
  • 19
4
votes
1 answer

Can Uncrustify and/or Universal Indent GUI split string literals?

I'm using the Universal Indent GUI and Uncrustify for my C++ project. The code width is set to 80 characters and the code format is almost satisfying. This seems to work fine for regular code, but string literals are not split, and I would like that…
janr
  • 3,664
  • 3
  • 24
  • 36
3
votes
1 answer

How to make Uncrustify force blank lines between functions?

I've been working on my uncrustify config for a few hours now and I'm very close to having it the way I need it. However, I can't find an option to control newlines between function bodies. Uncrustify always removes blank lines between functions,…
Pat Notz
  • 208,672
  • 30
  • 90
  • 92
3
votes
4 answers

Condense multiline C function prototypes

I have C function prototypes (certain windows api header files) that look like: int foo ( int a , int * b ) ; (they seem to have no coding convention) which I am trying to programmatically turn into a one-line prototype of the form (or something…
pseudosudo
  • 1,962
  • 1
  • 19
  • 30
3
votes
3 answers

How do I install uncrustify?

How do I install uncrustify? I followed the instruction to install uncrustify but when I run it, it does not work. Can anyone give me some help installing this tool? I want to run it on objective-c code in xcode 4. Thanks in adavance
lampShade
  • 4,361
  • 8
  • 34
  • 50
3
votes
2 answers

Uncrustify: Single Line Method Names & Remove spaces between double asterisk

Two related questions here. 1) What setting do I need to use to make multiline method name a single line? For example, I have this: - (NSArray *)nodesForXPath:(NSString *)xpath namespaces:(NSDictionary *)namespaces …
FreeAsInBeer
  • 12,937
  • 5
  • 50
  • 82
3
votes
1 answer

public, private, signal, etc inditation using uncrustify?

Where in uncrustify's configuration can I find public, private, protected, and Qt's slots and signals indentation? For example to change this: class MyClass { public: MyClass(); ~MyClass(); private: void method(); }; ... to this: class…
Kamil Zaripov
  • 904
  • 11
  • 33
3
votes
1 answer

How can I tell if two source files produce functionally identical code?

I'm using uncrustify to format a directory full of C and C++ code. I need to ensure that uncrustify won't change the resulting code; I can't do a diff on the object file or binaries because the object files have a timestamp and so won't ever be…
Alex Meuer
  • 1,621
  • 3
  • 26
  • 37
3
votes
0 answers

Uncrustify - only report errors without changing the file

Is it possible to only list the set of rules which would have failed on input file without actually applying them? I find it too harsh to just modify the file without letting developer know that file is getting changed under the hood but I would…
Klark
  • 8,162
  • 3
  • 37
  • 61
3
votes
1 answer

Xcode with uncrustify: how to align function declaration to colons?

I have the following code: @interface TRYoutubeManager : AFHTTPRequestOperationManager - (void)getVideosForDefaultChannelsWithSuccess:(void (^)(NSArray *youtubeVideosArray))successBlock failure:(void (^)(NSError *error))failureBlock; @end So I…
orkenstein
  • 2,810
  • 3
  • 24
  • 45
1 2
3
9 10