lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master e05d062 2/2: Document conventions for using w


From: Vadim Zeitlin
Subject: [lmi-commits] [lmi] master e05d062 2/2: Document conventions for using white space in headers
Date: Thu, 13 May 2021 06:01:05 -0400 (EDT)

branch: master
commit e05d06263b07b200ef9afb49c7d2d8cf4f9c7f35
Author: Vadim Zeitlin <vadim@tt-solutions.com>
Commit: Vadim Zeitlin <vadim@tt-solutions.com>

    Document conventions for using white space in headers
    
    Update the unofficial style guide with a section based on the commit
    message 4faab1050 (Adjust whitespace for microconcinnity, 2021-04-29).
---
 vz/Style-guide.md | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/vz/Style-guide.md b/vz/Style-guide.md
index b50ee8a..2b1caff 100644
--- a/vz/Style-guide.md
+++ b/vz/Style-guide.md
@@ -118,6 +118,26 @@ for(;;)
 E.g. `(x + y) * z` instead of `(x+y)*z`.
 
 
+### Headers conventions
+
+- One blank line below `config.hpp` because it's so special.
+- Comments on `#include` line begin in column 41.
+
+In `*_test.cpp` unit tests:
+
+    #include "pchfile.hpp"
+    [blank line]
+    #include "whatever_class_is_tested_here.hpp"
+    [blank line]
+    #include [other_headers_needed_here]
+
+Surround the middle line with blank lines, to distinguish the header
+that is to be tested from headers used by the tests. That emphasis
+makes the purpose of the test clearer, and that order ensures that
+the incidental headers that follow do not mask a defect in the
+physical design of the tested header.
+
+
 Naming Conventions
 ------------------
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]