How to handle formatting of custom macros in cpp/h files? #4404
Unanswered
mmichalek-ibl
asked this question in
Q&A
Replies: 1 comment
-
Fortunately, Uncrustify has an option so particular token can be treated as specific type. In my case, I can set to handle them as
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Lets say i have a class like this:
MACRO_1
andMACRO_2
are macros and they should stay how they are. Uncrustify should not reformat them. But based on my settings in config file for formatting functions, uncrustify changes this code like this:debug file: parsed-1.txt
and sometimes like this:
debug file: parsed-2.txt
I dont want uncrustify to indent or align code with macros at all. From debug files, it seems problem is that parser sees macros as ordinary functions.
Is it possible to tell uncrustify which "words" should be handled as macros, so it does not reformat them?
I have found settings
macro-open
andmacro-close
and these work fine for indentation, but i was not able to find some general setting to say "these words are macros, do not reformat them"thank you
Beta Was this translation helpful? Give feedback.
All reactions