mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
Hack clang-format config to format our macros better. (#2514)
This somewhat abuses control-flow macro handling in `clang-format` to get the behavior we want. Fortunately, I don't think we're ever likely to want this for its intended purpose so it seems harmless to co-opt it like this. If we really wanted, we can narrow it to `if`-macros, but I picked the simpler option to start. FWIW, I tried all the other macro formatting special cases to see if one would work but it didn't. Might be worth filing a feature request to get a `TypeDefinitionMacros` setting to compliment `TypenameMacros` and format like this does, but it seems (very) low priority.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
|
||||
namespace Carbon {
|
||||
|
||||
CARBON_DEFINE_RAW_ENUM_CLASS(TestKind, uint8_t){
|
||||
CARBON_DEFINE_RAW_ENUM_CLASS(TestKind, uint8_t) {
|
||||
#define CARBON_ENUM_BASE_TEST_KIND(Name) CARBON_RAW_ENUM_ENUMERATOR(Name)
|
||||
#include "toolchain/common/enum_base_test.def"
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user