Coding Standards Specification
Quality rules, linters, and code formatting standards for Python and TypeScript codebases.
Python / Django Backend Rules
- PEP 8 Compliance: Enforced via and
ruff.black - Imports: Group imports in standard PEP 8 order (Standard Library, Third-Party, Django, Local Apps).
- Docstrings: All public classes, ViewSets, services, and models must include triple-quoted docstrings.
- Type Annotations: Mandatory for service functions and utility methods:
python
def get_config(cls, tenant: Tenant, provider: str, key_name: str) -> str | None:
TypeScript / Next.js Frontend Rules
- Strict TypeScript: ,
noImplicitAnyenabled instrictNullChecks.tsconfig.json - Component Formatting: Functional React components with explicit prop interfaces:
tsx
interface Props { tenantId: string; onClose: () => void; } export const TenantModal: React.FC<Props> = ({ tenantId, onClose }) => { ... }; - Styling: Vanilla CSS design tokens (); no inline styling or ad-hoc Tailwind unless specified.
globals.css