Brad King
64b5520346
Isolate formatted streaming blocks with clang-format off/on
...
The clang-format tool can do a good job formatting most code, but
well-organized streaming blocks are best left manually formatted.
Find blocks of the form
os <<
"...\n"
"...\n"
;
using the command
$ git ls-files -z -- Source |
egrep -v -z '^Source/kwsys/' |
xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \
'<<[^\n]*\n(^ *("[^\n]*("|<<|;)$|;)\n){2,}'
Find blocks of the form
os << "...\n"
<< "...\n"
<< "...\n";
using the command
$ git ls-files -z -- Source |
egrep -v -z '^Source/kwsys/' |
xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \
'<<[^\n]*\n(^ *<<[^\n]*(\\n"|<<|;)$\n){2,}'
Surround such blocks with the pair
/* clang-format off */
...
/* clang-format on */
in order to protect them from update by clang-format. Use the C-style
`/*...*/` comments instead of C++-style `//...` comments in order to
prevent them from ever being swallowed by re-formatting of surrounding
comments.
2016-05-06 14:25:55 -04:00
..
2016-04-29 13:58:54 -04:00
2016-04-29 13:58:54 -04:00
2016-04-29 13:58:54 -04:00
2015-01-11 17:06:03 +01:00
2016-05-06 14:25:55 -04:00
2014-03-08 13:05:39 -05:00
2016-04-29 13:58:54 -04:00
2016-04-29 13:58:31 -04:00
2016-03-29 14:31:02 -04:00
2009-09-28 11:43:28 -04:00
2009-09-28 11:43:28 -04:00
2016-04-29 13:58:54 -04:00
2014-03-08 13:05:39 -05:00
2016-04-29 13:58:54 -04:00
2016-04-29 13:58:31 -04:00
2015-02-23 10:02:00 -05:00
2014-03-08 13:05:39 -05:00
2016-04-29 13:58:54 -04:00
2016-04-29 13:58:31 -04:00
2016-04-29 13:58:54 -04:00
2015-01-30 10:36:38 -05:00
2016-05-06 14:25:55 -04:00
2015-05-26 11:09:21 -04:00
2015-01-11 17:06:03 +01:00
2014-03-08 13:05:39 -05:00
2016-04-29 13:58:31 -04:00
2016-04-29 13:58:31 -04:00
2016-05-03 10:08:41 -04:00
2011-02-22 15:47:50 -05:00
2016-05-06 14:25:55 -04:00
2015-05-26 11:09:21 -04:00
2015-07-17 10:26:28 -04:00
2015-02-23 10:01:58 -05:00
2014-03-08 13:05:37 -05:00
2009-09-28 11:43:28 -04:00
2016-04-29 13:58:54 -04:00
2016-04-29 13:58:31 -04:00
2015-02-23 10:02:00 -05:00
2014-03-08 13:05:39 -05:00
2016-04-29 13:58:54 -04:00
2016-04-29 13:58:54 -04:00
2016-05-06 14:25:55 -04:00
2016-04-29 13:58:31 -04:00
2016-05-03 10:08:41 -04:00
2016-04-29 13:58:54 -04:00
2016-04-29 13:58:31 -04:00
2014-03-08 13:05:39 -05:00
2015-01-11 17:06:03 +01:00
2014-03-08 13:05:39 -05:00
2016-04-29 13:58:54 -04:00
2016-04-29 13:58:31 -04:00
2016-04-29 13:58:54 -04:00
2016-04-29 13:58:31 -04:00
2012-08-13 14:18:39 -04:00
2014-03-08 13:05:39 -05:00
2016-04-29 13:58:54 -04:00
2015-02-23 10:01:59 -05:00
2015-02-23 10:01:58 -05:00
2016-04-29 13:58:31 -04:00
2016-05-06 14:25:55 -04:00
2015-01-20 09:33:21 -05:00
2015-05-26 11:09:21 -04:00
2015-05-26 11:09:21 -04:00
2015-06-30 10:21:37 -04:00
2015-06-30 10:21:37 -04:00
2016-04-29 13:58:54 -04:00
2016-04-29 13:58:31 -04:00
2016-04-01 15:50:31 -04:00
2014-03-08 13:05:39 -05:00
2016-04-29 13:58:54 -04:00
2016-04-29 13:58:31 -04:00
2015-02-23 10:02:00 -05:00
2016-04-29 13:58:31 -04:00
2015-05-26 11:09:21 -04:00
2011-03-15 15:07:37 -04:00
2015-05-26 11:09:21 -04:00
2015-05-26 11:09:21 -04:00
2016-04-29 13:58:54 -04:00
2016-04-29 13:58:31 -04:00
2016-04-29 13:58:54 -04:00
2012-05-02 17:23:01 -04:00
2016-04-29 13:58:31 -04:00
2016-04-29 13:58:31 -04:00
2016-04-29 13:58:54 -04:00
2016-04-29 13:58:31 -04:00
2016-04-29 13:58:54 -04:00
2012-05-01 13:35:07 -04:00
2016-04-29 13:58:54 -04:00
2016-04-29 13:58:31 -04:00
2016-04-29 13:58:54 -04:00
2016-04-29 13:58:31 -04:00
2016-04-29 13:58:31 -04:00
2016-04-29 13:58:31 -04:00
2016-04-29 13:58:31 -04:00
2016-04-29 13:58:31 -04:00