Kleaf Development

This documentation summarizes principles used in Kleaf development.

Style Guides

Conventions

  • Follow these conventions for Macros, in particular:
    • In most cases, optional parameters should have a default value of None.
  • Avoid using unittest.suite . Reasons:
    • Individual test names are tagged with indices, not descriptive names. This makes failures hard to triage.
    • When items are reordered or inserted into the list, the indicies change, and thus individual test names change as well. Continuous testing processes may be confused and show incomplete test histories because of name changes.

Performance

  • For performance optimizations follow the tips in Optimizing Performance.
    • E.g. Use depsets instead of lists; depsets are a tree of objects that can be concatenated effortlessly.lists are concatenated by copying contents.