Skip to content

Commit 655f220

Browse files
author
thk123
committed
Adding extra information about invariant messages
1 parent 392c765 commit 655f220

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

CODING_STANDARD.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,11 @@ Formatting is enforced using clang-format. For more information about this, see
188188
- Avoid `assert`. If the condition is an actual invariant, use INVARIANT,
189189
PRECONDITION, POSTCONDITION, CHECK_RETURN, UNREACHABLE or DATA_INVARIANT. If
190190
there are possible reasons why it might fail, throw an exception.
191+
- Use "should" style statements for messages in invariants (e.g. "array
192+
should have a non-zero size") to make it clear both the violation and the
193+
expected behavior. (As opposed to "no zero size arrays" where it isn't
194+
clear if the zero-size array is the problem, or the lack of it).
195+
- The statements should start with a lower case letter.
191196
- All raw pointers (such as those returned by `symbol_tablet::lookup`) are
192197
assumed to be non-owning, and should not be `delete`d. Raw pointers that
193198
point to heap-allocated memory should be private data members of an object

0 commit comments

Comments
 (0)