Skip to content
Merged
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
15 changes: 8 additions & 7 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ Infrahub Python SDK - async/sync client for Infrahub infrastructure management.
```bash
uv sync --all-groups --all-extras # Install all deps
uv run invoke format # Format code
uv run invoke lint # Lint (ruff + mypy + yamllint)
uv run invoke lint # All linters (code + yamllint + documentation)
uv run invoke lint-code # All linters for Python code
uv run pytest tests/unit/ # Unit tests
uv run pytest tests/integration/ # Integration tests
```

## Tech Stack
## Tech stack

Python 3.10-3.13, UV, pydantic >=2.0, httpx, graphql-core

## Code Pattern
## Code pattern

```python
# Always provide both async and sync versions
Expand All @@ -27,7 +28,7 @@ node = await client.get(kind="NetworkDevice")
await node.save()
```

## Project Structure
## Project structure

```text
infrahub_sdk/
Expand All @@ -38,7 +39,7 @@ infrahub_sdk/
└── pytest_plugin/ # Custom pytest plugin
```

## Markdown Style
## Markdown style

When editing `.md` or `.mdx` files, run `uv run invoke lint-docs` before committing.

Expand All @@ -52,7 +53,7 @@ Key rules:

✅ **Always**

- Run `uv run invoke format lint` before committing Python code
- Run `uv run invoke format lint-code` before committing Python code
- Run markdownlint before committing markdown changes
- Follow async/sync dual pattern for new features
- Use type hints on all function signatures
Expand All @@ -69,7 +70,7 @@ Key rules:
- Modify generated code (protocols.py)
- Bypass type checking without justification

## Subdirectory Guides
## Subdirectory guides

- [docs/AGENTS.md](docs/AGENTS.md) - Documentation (Docusaurus)
- [infrahub_sdk/ctl/AGENTS.md](infrahub_sdk/ctl/AGENTS.md) - CLI development
Expand Down
12 changes: 9 additions & 3 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,14 @@ def lint_vale(context: Context) -> None:
context.run(exec_cmd)


@task
def lint_code(context: Context) -> None:
"""Run all code linters."""
lint_ruff(context)
lint_ty(context)
lint_mypy(context)


@task
def lint_docs(context: Context) -> None:
"""Run all documentation linters."""
Expand All @@ -229,9 +237,7 @@ def lint_docs(context: Context) -> None:
def lint_all(context: Context) -> None:
"""Run all linters."""
lint_yaml(context)
lint_ruff(context)
lint_ty(context)
lint_mypy(context)
lint_code(context)
lint_docs(context)


Expand Down