| # OpenCode Guide for or-tools repo | |
| ## Commands | |
| - **Install deps:** `uv sync` | |
| - **Add deps: `uv add dep` | |
| - **Lint:** `uv run ruff check app.py` | |
| - **Format:** `uv run ruff format app.py` | |
| - **Run Gradio app:** `uv run app.py` | |
| - **No tests currently found.** | |
| ## Code Style & Conventions | |
| - **Ruff** is used for linting & formatting; comply with its default (PEP8-like) style. | |
| - **Imports:** Built-ins, then 3rd party, then local; one per line; no unused imports. | |
| - **Types:** Type annotations are encouraged for function signatures and public APIs. | |
| - **Names:** Use `snake_case` for functions/vars, `CamelCase` for classes, `ALL_CAPS` for constants. | |
| - **Formatting:** 4-space indent, 120-char lines, no trailing whitespace. | |
| - **Error handling:** Prefer informative exceptions & user messages. Wrap untrusted input in try/except when user-facing. | |
| - **Docstrings:** Use triple-double-quote for all public functions/classes. Prefer Google or NumPy style. | |
| - **No tests yet:** Place tests in files named `test_*.py` when adding. | |
| - **Dependencies:** Only add to `pyproject.toml` | |
| *See https://docs.astral.sh/ruff/ for further lint rules. Contribute new code in line with this guide.* | |