only droids

This commit is contained in:
2026-02-11 15:22:02 +05:30
parent 5b304c5c2d
commit 1a6bffef2b
14 changed files with 171 additions and 491 deletions

24
.factory/rules/python.md Normal file
View File

@@ -0,0 +1,24 @@
# Python Rules
Always make sure to run linter and typecheck.
Possibly with `uv` like `uv run ruff check --fix` and `uv run ty`.
## Package management
use `uv pip` instead of `pip` as I always create my virtual environments with `uv` if it doesn't already exist. Example: `uv venv -p 3.12`
## Code style
Do not try to use comments to work around the linter (ruff) or type checker (ty) issues.
Chances are Makefiles are present read and use them. If doesn't exist then create it.
Run formatting after done with changes.
Never use `sys.path` or `pathlib` for resources. Use `importlib.resources`.
## Some rules to configure in ruff
- Ban relative imports.
- Keep imports at the top of the file.
## Type checking
Try to write type safe code. Use type hints and type annotations as much as possible. It will help you to catch bugs early and it will also help you to understand the code better.