clang-format: better handle namespace macros
Needs ReviewPublic

Authored by Typz on Sep 13 2017, 9:27 AM.

Details

Summary

Other macros are used to declare namespaces, and should thus be handled
similarly. This is the case for crpcut's TESTSUITE macro, or for
unittest-cpp's SUITE macro:

TESTSUITE(Foo) {
TEST(MyFirstTest) {
  assert(0);
}
} // TESTSUITE(Foo)

This patch deals with this cases by introducing a new option to specify
lists of namespace macros. Internally, it re-uses the system already in
place for foreach and statement macros, to ensure there is no impact on
performance.

Typz created this revision.Sep 13 2017, 9:27 AM
Typz added a reviewer: klimek.Sep 13 2017, 9:30 AM

I think instead of introducing more and more special cases of macros we might want to handle, we should instead allow specifying macro productions globally.

Typz added a comment.Tue, Oct 24, 8:57 AM

I think instead of introducing more and more special cases of macros we might want to handle, we should instead allow specifying macro productions globally.

what do you mean?
Do you mean to group all the macro configuration options into "Macros" field, still containing one field for each kind of macro? Or do you have something else in mind?