-
Notifications
You must be signed in to change notification settings - Fork 98
docs: Adding Code rules page #3915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
jafranc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great ! Maybe there is the work of 2 docs there (or more 😄 )
| Additional Validation Guidelines | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| - Use ``setInputFlag()`` to mark parameters as ``REQUIRED`` or ``OPTIONAL`` | ||
| - Use ``setApplyDefaultValue()`` to provide sensible defaults | ||
| - Use ``setRTTypeName()`` for runtime type validation (e.g., ``rtTypes::CustomTypes::positive``) | ||
| - Document valid ranges in ``setDescription()`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be in the Wrapper section ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels strange to me, as the wrapper section is for documentation requirement. My goal here is to precise validation rules. What do you think?
|
Thanks @jafranc for your feedback, I'll take them into account. |
|
@jafranc @rrsettgast the rule page is now separated in two and correctly linked in the indexes |
jafranc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great doc !!
src/docs/sphinx/developerGuide/Contributing/CodingPractices.rst
Outdated
Show resolved
Hide resolved
| **Avoid magic values**: | ||
|
|
||
| - **arbitrary values should not be written more than once**, define constants, consider using or extending ``PhysicsConstants.hpp`` / ``Units.hpp``, | ||
| - **Prefer to let appear the calculus of constants** rather than writing its value directly without explaination (constexpr has no runtime cost). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be tempted to include a smooth transition and link to the next page CodeGeosFeatures.rst
Co-authored-by: Jacques Franc <49998870+jafranc@users.noreply.github.com>
GEOS Code Rules
Aims at writing down the coding standards for GEOS, focusing on type safety, error handling, parallelism, and performance. Key principles include:
These rules ensure code quality, consistency, and maintainability across the GEOS codebase.
This PR is before #3914