Add and update docstrings for profile services and schema

Added or revised concise, PEP 257-compliant docstrings for all public classes and methods in profile export/import services, router endpoints, exceptions, and MFA schema. Updated docstring formats to match new repository guidelines, clarified argument and return value descriptions, and removed extended explanations and examples. Also updated .github/copilot-instructions.md with new Python code style and docstring requirements.
This commit is contained in:
João Vitória Silva
2025-10-28 15:33:22 +00:00
parent 05dfdab788
commit 9fbd86a8a2
7 changed files with 760 additions and 766 deletions

View File

@@ -132,4 +132,68 @@ Repository root:
- **Authentication**: JWT tokens with 15-minute access tokens
- **Deployment**: Docker containers with multi-stage builds
Always prioritize frontend development workflow for UI changes and use Docker for full-stack development.
Always prioritize frontend development workflow for UI changes and use Docker for full-stack development.
## Task Execution Guidelines
- **Do ONLY what is explicitly requested** - do not add extra
documentation, summaries, or "helpful" files unless specifically
asked.
- If asked to implement a feature, implement ONLY that feature - no
additional documentation beyond code comments.
- Do not create README files, summary documents, quick reference
guides, or completion reports unless explicitly requested.
- When implementing changes, focus on the code implementation itself,
not supplementary documentation.
- Ask for clarification if the scope is unclear rather than assuming
additional deliverables are wanted.
## Python Code Style Requirements
### Modern Python Syntax (Python 3.13+)
- Use modern type hint syntax: `int | None`, `list[str]`,
`dict[str, Any]`
- Do NOT use `typing.Optional`, `typing.List`, `typing.Dict`, etc.
- Target Python 3.13+ features and syntax
### PEP 8 Line Limits
- Code lines: **79 characters maximum**
- Comments and docstrings: **72 characters maximum**
- Enforce strictly - no exceptions
### Docstring Standard (PEP 257)
- **Always follow PEP 257** with Args/Returns/Raises sections
- **Format**: One-line summary, blank line, then
Args/Returns/Raises sections
- **Always include Args/Returns/Raises** even when parameters seem
obvious
- **NO examples** in docstrings - keep in external docs or tests
- **NO extended explanations** - one-line summary + sections only
- **Keep concise** - describe what, not how
**Function docstring format:**
```python
def function(param: str) -> int:
"""
One-line summary of what this does.
Args:
param: Description of param.
Returns:
Description of return value.
Raises:
ValueError: When param is invalid.
"""
```
**Class docstring format:**
```python
class MyClass:
"""
One-line summary of the class.
Attributes:
attr: Description of attribute.
"""
```