Code Style GuidelinesΒΆ
Rules for writing code in dimos. These address recurring issues found in code review.
No comment bannersΒΆ
Don't use decorative section dividers or box comments.
# BAD
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# 1. Basic iteration
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# BAD
# -------------------------------------------------------------------
# Section name
# -------------------------------------------------------------------
# GOOD: just use a plain comment if a section heading is needed
# Basic iteration
If a file has enough sections to warrant banners, it should probably be split into separate files instead. For example, instead of one large test_something.py with banner-separated sections, create a something/ directory:
# BAD
test_something.py (500 lines with banner-separated sections)
# GOOD
something/
test_iteration.py
test_lifecycle.py
test_queries.py
No __init__.py re-exportsΒΆ
Never add imports to __init__.py files. Re-exporting from __init__.py makes imports too wide and slow. Importing one symbol pulls in the entire package tree.