This commit is contained in:
LASTA_DEV01\lasta
2026-05-13 19:57:34 +09:00
parent 2e9204243d
commit 9e88f4c7ad
4310 changed files with 48538 additions and 905279 deletions

View File

@@ -0,0 +1,13 @@
---
description: "Documentation conventions"
globs:
- "docs/**/*.md"
- "mkdocs.yaml"
alwaysApply: false
---
# Documentation Rules
- Write docs in Markdown with clear headings and code examples.
- Update `mkdocs.yaml` navigation when adding new docs.
- Keep `README.md` concise, and move long explanations to `/docs`.
- Use Python code fences (```python … ```) in examples.

View File

@@ -0,0 +1,13 @@
---
description: "Conventions for using Pydantic models and settings"
globs:
- "**/*.py"
alwaysApply: false
---
# Pydantic Rules
- Use `pydantic.BaseModel` for request/response schemas.
- For configuration, use `pydantic_settings.BaseSettings` (v2).
- Always provide default values or use `...` for required fields.
- Use model validators (`@field_validator`, `@model_validator`) instead of custom init logic.
- Keep models small and focused on one purpose.

View File

@@ -0,0 +1,12 @@
---
description: "Use `uv run` for running Python code instead of raw python3"
globs:
- "**/*.py"
alwaysApply: true
---
# Running Python code
- **Do not** run `python3 -c` directly.
- Always invoke Python code using `uv run python <script>` or `uv run <module>` when executing project scripts.
- Use the `uv` environment so that dependencies from `uv.lock` are respected.
- This applies to both interactive code execution and testing.

View File

@@ -0,0 +1,16 @@
---
description: "Follow project style guidelines for Python code"
globs:
- "**/*.py"
alwaysApply: true
---
# Python Coding Rules
- Use python 3.12 conventions: use `type | None` instead of `Optional` etc
- Use type hints everywhere (PEP 484).
- Use snake_case for functions and variables, PascalCase for classes.
- Use `pydantic.BaseModel` for structured data, not dataclasses
- Avoid unused imports.
- Use `async`/`await` where appropriate.
- Always keep functions small and composable.
- Avoid using hasattr at all costs, it's not safe

View File

@@ -0,0 +1,16 @@
---
description: "Testing guidelines"
globs:
- "test/**/*.py"
alwaysApply: false
---
# Testing Guidelines
- Use `pytest` with descriptive test function names.
- Prefer fixtures over global state.
- For async code, use `pytest-asyncio`.
- Ensure test coverage for:
- Pydantic model validation
- Env config via `BaseSettings`
- Error cases and edge cases
- Run tests with `uv run pytest test`.

View File

@@ -0,0 +1,11 @@
---
description: "Dependency management with uv"
globs:
- "pyproject.toml"
- "uv.lock"
alwaysApply: false
---
# Dependency Management
- Pin versions in `pyproject.toml` for reproducibility.
- Run `uv pip check` to validate the dependency tree.