ontology
This commit is contained in:
13
ontology_platform/vendored/ontocast/.cursor/rules/docs.mdc
Normal file
13
ontology_platform/vendored/ontocast/.cursor/rules/docs.mdc
Normal 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.
|
||||
@@ -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.
|
||||
@@ -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.
|
||||
@@ -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
|
||||
16
ontology_platform/vendored/ontocast/.cursor/rules/tests.mdc
Normal file
16
ontology_platform/vendored/ontocast/.cursor/rules/tests.mdc
Normal 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`.
|
||||
@@ -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.
|
||||
Reference in New Issue
Block a user