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
0
votes
1 answer

Newline between bodieless while loops and semicolon

While using uncrustify, I encountered a problem with while loops. If the while loop has no body, a trailing semicolon will get pushed to the next line. On the GitHub and on this website I found no mention of this whatsoever. Is the problem related…
InfoMathze
  • 176
  • 6
0
votes
1 answer

Configuration for newLine for block parameter in Uncrustify formatter

I want to know as if there exists configuration in Uncrustify, so that following formatting(or at least some part of it) can be achieved(language is objective-c). Original code: @interface BaseVideoViewController : BaseViewController …
user3247895
  • 473
  • 1
  • 6
  • 14
0
votes
1 answer

uncrustify wrong newline after member initializer ':'

anybody an idea to avoid the 'wrong' newlines after ':'? now it looks like this: *Servo=(APOS_typ){Intern: (APOSINT_typ){CCom: Servo->Intern.CCom, MasterOf: …
0
votes
1 answer

Uncrustify code formatter removes space in C++ one-liner

How to prevent Uncrustify code formatter from keeping one space in C++ one-liner between { and the rest code? So, it changes this code const Foo &GetBar() const { return bar; } to this const Foo &GetBar() const {return bar; } I search for return…
sashadereh
  • 223
  • 1
  • 15
0
votes
1 answer

Uncrustify: Add new line after angle bracket in multi line typedef using a template

Using the Uncrustify tool I am looking for a rule to add a new line after an opening angle bracket if the opening and the closing angle bracket are not on the same line. In other words I would like to put a new line before the first argument of a…
Bernhardt Rogge
  • 341
  • 2
  • 6
0
votes
1 answer

Uncrustify file association

Is there a way to configure uncrustify to associate a specific language to a custom file extension? I am using visual studio code on Linux with the uncrustify plugin. Formatting works perfectly if I rename a .groovy file to .java. I would like to…
LZR
  • 948
  • 10
  • 28
0
votes
1 answer

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…
Ramakrishnan Kannan
  • 604
  • 1
  • 11
  • 24
0
votes
1 answer

How do I get Uncrustify to indent dot continuation lines?

How can I configure Uncrustify to format this: entity.Property(e => e.CaseId) .HasColumnName("CaseID") .HasMaxLength(20); like this: entity.Property(e => e.CaseId) .HasColumnName("CaseID") .HasMaxLength(20); Thanks.
Sako73
  • 9,957
  • 13
  • 57
  • 75
0
votes
1 answer

Uncrustify + Lambda

I'm having trouble getting uncrustify to format C++ lambdas this is what it turns my lambda into: auto print = [](auto const &i, qi::unused_type, qi::unused_type) { qDebug() << i; }; This is what I would…
Tom Kulaga
  • 138
  • 7
0
votes
1 answer

Uncrustify edit file instead of piping in Windows

How would one directly change the file being formatted by Uncrustify in Windows? All the docs suggest is to pipe the standard output to another file. Is there a clean batch script or a way in Uncrustify to just change the file directly? I tried…
Stefan G.
  • 167
  • 7
0
votes
1 answer

uncrustify options for lambda

My question is about Uncrustify 0.62 and lambdas. What uncrustify.cfg options can format code like this: void f1b() { std::for_each( a, b, [ ] ( int& b ) -> foo { b += 3; return(beer); } …
0
votes
1 answer

Uncrustify ignore formatting new line at long objective c method decleration

I want uncrustify to ignore new lines which is formatted by developer but with my config file it does not do this. What my code looks like and i want it unchanged + (void)doSometingAwesomeWithIndex:(NSInteger)index …
Ahmet Gulden
  • 2,063
  • 2
  • 15
  • 23
0
votes
1 answer

Uncrustify obj-c: Add newline between parameters in function declaration

I am looking for some configuration to make this code - (void)myFunctionWithParameter:(NSString *)param1 secondParameter:(NSString *)param2 { } to: - (void)myFunctionWithParameter:(NSString *)param1 secondParameter:(NSString…
Luda
  • 7,282
  • 12
  • 79
  • 139
0
votes
1 answer

How to remove SPACE in Ucrustify's "tab tab SPACE" - indentation?

My source code namespace one { namespace two { -> static const class Example : -> -> Int1, Int2, Int3 -> { -> public: -> Example::~Example() : -> -> S1(), -> -> S2(), -> -> S3() { -> -> // if statements with empty braces -> -> if ( x…
S.H
  • 875
  • 2
  • 11
  • 27
0
votes
0 answers

Uncrustify collapses multiple white spaces inside statement

I wonder if there is a way to ask uncrustify to leave aligning spaces inside statements, so that a group of functions calls get properly aligned like: if (a) f(5); if (a && b) f(6); if (c) f(7); if (a && b && c) f(8); With…
1 2 3
9
10