I'm editing my .uncrustify.cfg
file to make it more readable. I just want to reformat like this:
Two lines in:
# Add or remove between the parens in the function type: 'void (*x)(...)'
sp_after_tparen_close = ignore # ignore/add/remove/force
One line out:
sp_after_tparen_close = ignore # ignore/add/remove/force# Add or remove between the parens in the function type: 'void (*x)(...)'
Perl seems to be the way to go, but the syntax overwhelms me. When I have a spare decade, I'll learn it ;-)
To make it a bit more generic:
Two lines in:
#a comment line
some code
One line out:
some code # a comment line
==========================
John: Two lines done by hand:
nl_while_brace = ignore # I,A,R,F # Add or remove newline between 'while' and '{'
nl_scope_brace = ignore # I,A,R,F # Add or remove newline between 'scope (x)' and '{' (D)
... two pairs that didn't combine using your awk:
# Add or remove newline between 'unittest' and '{' (D)
nl_unittest_brace = ignore # I,A,R,F
# Add or remove newline between 'version (x)' and '{' (D)
nl_version_brace = ignore # I,A,R,F
perl -e ...
(which does not save any time unless you are sure about what you are doing). You should also explain the nature of the change more generically, if appropriate, since changing exactly those lines is different than changing lines which meet a certain criteria.{}
code tool in the SO editor to mark your literal code blocks.