Questions tagged [astyle]

Artistic Style is a source code indenter, formatter, and beautifier for the C, C++, C# and Java programming languages. It can be used from a command line, or it can be incorporated as classes in another C++ program.

Artistic Style is a source code indenter, formatter, and beautifier for the C, C++, C# and Java programming languages.

There are command line options for defining bracket settings, indentation, white-space padding, and line endings. This can be applied to a single file, a set of files, or whole directory folders recursively. Additionally one can choose to create a backup file for each file touched.

For more information, see the project's official site

58 questions
0
votes
0 answers

Remains second+ parameter line unaffected by AStyle

I'm trying to formal my c++ code with AStyle utility and want to remain second line of function parametes unaffected by the tool. E.g. input file: class C { public: void func(double d, int i) const; }; void C::func(double d, …
αλεχολυτ
  • 4,792
  • 1
  • 35
  • 71
0
votes
2 answers

Astyle not working

I downloaded Astyle from here: https://sourceforge.net/projects/astyle/files/ When I execute Astyle.exe in \bin a command prompt opens which looks like this: I can't execute any commands. Astlye.exe seems to be stuck. I've read the documentation…
YokeM
  • 75
  • 6
0
votes
0 answers

How to run AStyle from inside Sublime?

I already tried using the SublimeAStyle Package, but it didn't work. When I pressed the keys, the command would not fire (I checked in the console). Now I am trying to write my own key-shortcut to run the program on my source code. I have this: {…
theEpsilon
  • 1,800
  • 17
  • 30
0
votes
0 answers

In Bash, how can I check the version of Artistic Style?

I am writing a portable procedure (i.e. I am not using dpkg) in a Bash script that ensures that certain program versions are available. I can get the version of indent in the following way: version_indent="$(echo "$(indent --version)" | cut -d" "…
d3pd
  • 7,935
  • 24
  • 76
  • 127
0
votes
1 answer

How to check if source code file confirms to given astyle rules?

astyle modifies the file provided as an argument. I just want to check if particular file is astyle confirmed. If not return error in svn pre-commit hook. But astyle man page does not say anything about return value or about how to prevent in place…
rahul.deshmukhpatil
  • 977
  • 1
  • 16
  • 31
0
votes
1 answer

Astyle does not work in Windows

I just download Astyle from SourceForge. When I execute Astyle.exe in /bin, it said Cannot convert to multi-byte string, reverting to English. I don't know what happened. I find there is a similar question, but that is about Astyle in OS X. Here…
Harlan
  • 1
  • 3
0
votes
2 answers

Astyle with --remove-brackets and a macro

With the code: #define MACRO(A,B) foo(A); bar(B) if(true) { MACRO(A,B); } Astyle will remove the brackets around the macro call if(true) MACRO(A,B); Fortunately I found a solution. If I place the ; inside the macro, Astyle will…
nowox
  • 25,978
  • 39
  • 143
  • 293
0
votes
1 answer

Astyle C++ indentation of variable init in constructor

I'm looking for a Astyle option to indent C++ constructors from : foo::foo(int param) : m_param(param) , m_x(0) , m_y(0) To : foo::foo(int param) : m_param(param) , m_x(0) , m_y(0) I havn't found that in…
MokaT
  • 1,416
  • 16
  • 37
0
votes
1 answer

Changing all my indents to 3 spaces. Code::Blocks

I have to submit an assignment and they want all the indents to be 3 spaces. I don't know how to change the settings of Astyle.dll so that it will change them 3 spaces instead of the default 4. Any ideas? Also, Astyle seems to like having no indent…
user3593486
  • 47
  • 2
  • 7
0
votes
1 answer

How to Ignore files with a given prefix?

Using astyle, I want to make it skip the files generated by qt's MOC as for some reason this files make astyle crash. I'm using a simple convention of using the moc_ prefix for those files. Is there a way to globally configure astyle to ignore…
tutuca
  • 3,444
  • 6
  • 32
  • 54
0
votes
1 answer

Is it possible to break `case xx : {` into two line with AStyle?

I need to format following code switch(i) { case 1: { printf("a"); break; } into: switch(i) { case 1: { printf("a"); break; } with keeping the k&r bracket style on…
Jichao
  • 40,341
  • 47
  • 125
  • 198
0
votes
1 answer

Invalid option file options: pad=oper

Getting this error: Invalid option file options on trying to invoke Astyle via C# System.Diagnostics.Process pProcess = new System.Diagnostics.Process(); pProcess.StartInfo.FileName =…
kingpin
  • 83
  • 3
  • 12
0
votes
2 answers

Invoking Astyle on a string or a file via C#

I am generating C++ code via C#, for some reason after applying astyle my generated code compiles. So is there a way I can invoke astyle from within my C# windows application?
kingpin
  • 83
  • 3
  • 12
1 2 3
4