Code conventions for AI-assisted development on adp-sdk.
- All code, comments, and Git commit messages must be in English.
- Formatting: Ruff, 120-char line length. Run
uv run ruff check src testsanduv run ruff format --check src testsbefore committing. - Type checking:
uv run pyrightwithstrict = true. All parameters and return types must be annotated. Usestr | Noneandlist[str](notOptional/List). - Imports: absolute only, no star imports. Use aliases to resolve name collisions (e.g.,
from pydantic import Field as PydanticField). - Docstrings: Google-style. Required for modules, classes, and public methods. Use
Args:,Returns:,Raises:sections. - Naming: PascalCase classes, snake_case functions/files, UPPER_SNAKE_CASE constants,
_prefixfor private members. - Class layout: public methods before private methods. Use
@propertyfor read-only accessors. Prefer@dataclassfor plain data; PydanticBaseModelfor serializable models. - Logging: module-level
logger = logging.getLogger(__name__),%s-style formatting,exc_info=Truefor caught exceptions. - Error handling: inherit from a specific base, use
!rin messages, chain withraise ... from e. __init__.py: define__all__with category comments; re-export from submodules.
- Use
unittest.TestCase(sync) andunittest.IsolatedAsyncioTestCase(async). Do not use bare pytest classes orpytest.fixture. - Use
self.assert*methods. Do not use the bareassertkeyword. - Naming:
test_<module>.py→Test<Feature>(unittest.TestCase)→test_<case>. - Use
# ===...===separators between test classes. Place helpers (stubs, factories) at file top with_prefix. - Run tests:
uv run python -m unittest discover -s tests -v
- Issue templates:
.github/ISSUE_TEMPLATE/(bug-report, feature-request, improvement, epic, subtask). - PR template:
.github/PULL_REQUEST_TEMPLATE.md.