... | ... | @@ -6,16 +6,6 @@ This page documents some coding guidelines for the Kea project. See [Stork codin |
|
|
|
|
|
Those apply to all code in all languages.
|
|
|
|
|
|
## Testing and Documentation addresses and prefixes
|
|
|
|
|
|
Use 192.0.2.0/24 and 2001:db8::/32 for purposes like addresses used in test cases or examples in documentation (source: [RFC5737](https://datatracker.ietf.org/doc/html/rfc5737) and [RFC3849](https://datatracker.ietf.org/doc/html/rfc3849)). Likewise, use reserved example domain names such as example.com, .test, .example, etc for domain names used in these cases. They are reserved by specifications and should be the safest in terms of collision avoidance.
|
|
|
|
|
|
## Dead code
|
|
|
|
|
|
Dead code is bad; it suffers from code rot, and it looks unclean. There are some circumstances where there is a reason to keep a bit of unused code around for a while, but these should be the exception rather than the rule, and it should be very clear why it is there, and on what conditions and when it will be re-enabled or removed completely.
|
|
|
|
|
|
Any dead code (both files that are unused and blocks of commented-out code) should in principle be removed. If there is a very good reason to keep it around for a while, it must be accompanied by a comment explaining why it is still there, and when it will be removed or enabled again. This comment should point to a ticket so that we do not forget about it.
|
|
|
|
|
|
## Line length
|
|
|
|
|
|
Source code not exceeding 80 columns is preferred. This is derived from
|
... | ... | @@ -40,6 +30,16 @@ if (JS_DefineProperty(cx, o, "data", |
|
|
0, 0, JSPROP_ENUMERATE) != 0) {
|
|
|
```
|
|
|
|
|
|
## Testing and Documentation addresses and prefixes
|
|
|
|
|
|
Use 192.0.2.0/24 and 2001:db8::/32 for purposes like addresses used in test cases or examples in documentation (source: [RFC5737](https://datatracker.ietf.org/doc/html/rfc5737) and [RFC3849](https://datatracker.ietf.org/doc/html/rfc3849)). Likewise, use reserved example domain names such as example.com, .test, .example, etc for domain names used in these cases. They are reserved by specifications and should be the safest in terms of collision avoidance.
|
|
|
|
|
|
## Dead code
|
|
|
|
|
|
Dead code is bad; it suffers from code rot, and it looks unclean. There are some circumstances where there is a reason to keep a bit of unused code around for a while, but these should be the exception rather than the rule, and it should be very clear why it is there, and on what conditions and when it will be re-enabled or removed completely.
|
|
|
|
|
|
Any dead code (both files that are unused and blocks of commented-out code) should in principle be removed. If there is a very good reason to keep it around for a while, it must be accompanied by a comment explaining why it is still there, and when it will be removed or enabled again. This comment should point to a ticket so that we do not forget about it.
|
|
|
|
|
|
# Python Style
|
|
|
We don't use python code anymore in the core code. If you found any leftovers, feel free to remove them.
|
|
|
|
... | ... | |