Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.7
hooks:
Comment on lines +2 to +4
- id: ruff
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.17.1
hooks:
- id: mypy
files: ^src/
args:
- --ignore-missing-imports
- --allow-untyped-decorators
- --disable-error-code=misc
Comment on lines +11 to +16

- repo: https://github.com/PyCQA/bandit
rev: 1.8.6
hooks:
- id: bandit
args:
- -c
- pyproject.toml
files: ^src/
10 changes: 10 additions & 0 deletions Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,17 @@ bandit -r src -c pyproject.toml
# All-in-one via pre-commit
pre-commit run --all-files
```
Install pre-commit hooks:

```bash
pre-commit install
```

Run all hooks manually:

```bash
pre-commit run --all-files
```
Pre-commit is configured to run ruff, mypy, and bandit on every commit.

---
Expand Down
3 changes: 2 additions & 1 deletion src/modeldock/adapters/registry/bundled.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ def _to_spec(raw: Dict[str, Any]) -> ModelSpec:
raw["category"] = Category.from_value(raw["category"])
raw["capabilities"] = [Capability.from_value(c) for c in raw.get("capabilities", [])]
raw["backend_hints"] = [RuntimeBackend.from_value(b) for b in raw.get("backend_hints", [])]
return ModelSpec.model_validate(raw)

return cast(ModelSpec, ModelSpec.model_validate(raw))

# --- RegistryPort -----------------------------------------------------

Expand Down
Loading