Format with uncrustify#3388
Conversation
danmar
left a comment
There was a problem hiding this comment.
uncrustify looks promising
| private: | ||
| class ArgumentInfo { | ||
| public: | ||
| public: |
There was a problem hiding this comment.
hmm this indentation looks very strange. fixable?
There was a problem hiding this comment.
Yes! It was fixable with:
indent_access_spec = -4
|
as far as I see uncrustify is lightweight and easy to build. and the formatting looks acceptable. It is totally acceptable for me. However I do not understand the problem with astyle. I do not get any compilation error when I build for instance astyle-3.0.1 with g++ 8.3.0. The formatting is not perfect with astyle-3.0.1 but it's something at least I can accept. I do not believe formatting will be perfect with any tool. As you said somewhere it's not a good idea to clutter the code with INDENT-* comments. |
| std::cout << "Unknown exception" << std::endl; | ||
| } | ||
| return EXIT_FAILURE; | ||
| } |
There was a problem hiding this comment.
this is unfortunate. astyle handled this piece of code better. but I guess it's a rare case and can accept it.
There was a problem hiding this comment.
Yea uncrustify can't match up the braces, it throws this error on this file:
flag_parens(22): no match for '{' at [93:9] [CallStack:-DEBUG NOT SET-]
Doing
The syntax errors are unacceptable. Also, I find the readability to be unacceptable(like here), which is why I use
Well tools like uncrustify and astyle are definitely not perfect as they only consider one way to format whereas as clang-format will try to choose the best formatting among different possibilities. Since you dont want to use clang-format due to slow internet connection, I think uncrustify is a much better option. It has more settings that can be tweaked and is being actively developed so the issues that we find may be fixed in a future version. |
| , mExitAfterPrint(false) | ||
| { | ||
| } | ||
| , mShowHelp(false) |
There was a problem hiding this comment.
hmm.. can this comma have the same indentation as the colon?
There was a problem hiding this comment.
Yes, but if we use trailing commas then the variables will be aligned to the : instead of variable name.
There was a problem hiding this comment.
ok that is unfortunate.. but maybe we can adjust the source files..
There was a problem hiding this comment.
So I changed the indent_constr_colon setting to false to get it to align with leading commas. You can tweak this and the source files to get the style you want. There might be a way to enforce trailing commas, but I am not sure.
|
ok let's switch to uncrustify.. |
|
I hope you are happy.. I merge this. |
|
Thanks! |
No description provided.