Skip to content

Commit b39726b

Browse files
committed
Coding standard: Deprecation rules
Thus far, we operated an informal deprecation policy. This codifies our informal six-months rule.
1 parent 857e67f commit b39726b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

CODING_STANDARD.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@ Formatting is enforced using clang-format. For more information about this, see
101101
- Use comments to explain the non-obvious
102102
- Use #if 0 for commenting out source code
103103
- Use #ifdef DEBUG to guard debug code
104+
- When deprecating code, use the `DEPRECATED` macro, preferably together with
105+
`SINCE`. For example,
106+
```
107+
DEPRECATED(SINCE(2019, 1, 31, "use other_method() instead"))
108+
void deprecated_method();
109+
```
110+
marks `deprecated_method` as deprecated as of 2019-01-31. Any deprecated
111+
functionality should remain in place for at least six months from the date of
112+
deprecation. Before deprecating code, all in-tree uses should be replaced.
104113
105114
# Naming
106115
- Identifiers should make clear the purpose of the thing they are naming.

0 commit comments

Comments
 (0)