GD0107.rst 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. GD0107: Types not derived from Node should not export Node members
  2. ==================================================================
  3. ==================================== ======================================
  4. Value
  5. ==================================== ======================================
  6. **Rule ID** GD0107
  7. **Category** Usage
  8. **Fix is breaking or non-breaking** Breaking
  9. **Enabled by default** Yes
  10. ==================================== ======================================
  11. Cause
  12. -----
  13. A type that doesn't derive from ``Node`` contains an exported field or property
  14. of a type that derives from ``Node``.
  15. Rule description
  16. ----------------
  17. Exported nodes are serialized as ``NodePath``. Only types derived from ``Node``
  18. are able to get the node instance from the ``NodePath``.
  19. How to fix violations
  20. ---------------------
  21. To fix a violation of this rule, avoid exporting ``Node`` members on a type that
  22. doesn't derive from ``Node``, or consider exporting a ``NodePath``.
  23. When to suppress warnings
  24. -------------------------
  25. Do not suppress a warning from this rule. Types that don't derive from ``Node``
  26. will be unable to retrieve the right node instance for exported ``Node`` members,
  27. resulting in unexpected runtime errors.