From 093284673e138435221d14ee3fe3f5159f6f5d4b Mon Sep 17 00:00:00 2001 From: Jack Stouffer Date: Wed, 8 Mar 2017 14:32:07 -0500 Subject: [PATCH] Add style rule for Phobos about field declarations --- dstyle.dd | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dstyle.dd b/dstyle.dd index 1ada5f0acb..f7039d2dc3 100644 --- a/dstyle.dd +++ b/dstyle.dd @@ -359,6 +359,23 @@ void foo(R)(R r) if (R == 1) ------------------------------- ) +$(LISTSECTION Class/Struct Field Declarations, + $(LI In structs and classes, there should only be one space between the type of + the field and its name. This avoids problems with future changes generating a + larger git diff than necessary.) +------------------------------- +class MyClass +{ + // bad + int a; + double b; + + // good + int x; + double y; +} +------------------------------- +) $(BR) $(P