Skip to content

Commit d939a5a

Browse files
author
Amanda Butler
authored
Add sections to design_guidelines.md
Add sections from PR #474.
1 parent c921ce8 commit d939a5a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

docs/reference/contributing/guidelines/design_guidelines.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ A general module can be split into two APIs, the frontend (or user API) and the
126126
- Avoid operations that can fail if you can't signal an error. Class constructors should not fail.
127127
- Nonrecoverable errors (such as OOM and mutex lock in interrupt) should not return to users.
128128
- Recoverable errors (such as UDP packet loss) should be propagated to the user via error code.
129+
- Handle deprecation with care. We do not remove deprecated APIs until the next major OS revision. Reasons for deprecation include:
130+
- Design pattern traps that cause developers to write incorrect code.
131+
- Code that is functionally incorrect.
132+
- Code that is not safe (syncronization) or that results in undefined behavior.
129133
130134
##### API design - porting layer
131135
@@ -159,7 +163,10 @@ A general module can be split into two APIs, the frontend (or user API) and the
159163
osStatus lock(uint32_t millisec=osWaitForever);
160164
```
161165
162-
- The doxygen of each class's header file should contain a simple use example.
166+
- The doxygen of each class's header file must contain a use example using `@code` and `@endcode`.
167+
- Each API should also provide an `@code` and `@endcode` section building upon the class header example.
168+
- If more specific information is needed about a method, this should be accomplished using `@note`.
169+
- If a method is deprecated, it must use the `@deprecated` tag and include a description of what method to replace it with.
163170
- Each module should provide a README that documents the module:
164171
- The README should start with a small paragraph describing the module to users with no prior knowledge.
165172
- The README should contain a code example showing how to use the module.

0 commit comments

Comments
 (0)