@@ -191,8 +191,14 @@ Formatting is enforced using clang-format. For more information about this, see
191
191
- The type is explicitly repeated on the RHS (e.g. a constructor call)
192
192
- Adding the type will increase confusion (e.g. iterators, function pointers)
193
193
- Avoid ` assert ` . If the condition is an actual invariant, use INVARIANT,
194
- PRECONDITION, POSTCONDITION, CHECK_RETURN, UNREACHABLE or DATA_INVARIANT. If
195
- there are possible reasons why it might fail, throw an exception.
194
+ PRECONDITION, POSTCONDITION, CHECK_RETURN, UNREACHABLE or DATA_INVARIANT (also
195
+ see the documentation of the macros in ` src/util/invariant.h ` ). If there are
196
+ possible reasons why it might fail, throw an exception.
197
+ - Use "should" style statements for messages in invariants (e.g. "array
198
+ should have a non-zero size") to make both the violation and the expected
199
+ behavior clear. (As opposed to "no zero size arrays" where it isn't clear
200
+ if the zero-size array is the problem, or the lack of it).
201
+ - The statements should start with a lower case letter.
196
202
- All raw pointers (such as those returned by ` symbol_tablet::lookup ` ) are
197
203
assumed to be non-owning, and should not be ` delete ` d. Raw pointers that
198
204
point to heap-allocated memory should be private data members of an object
0 commit comments