Skip to content

Commit a62988a

Browse files
committed
Add invoke command specifically for code linting
1 parent 44389d2 commit a62988a

2 files changed

Lines changed: 16 additions & 10 deletions

File tree

AGENTS.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ Infrahub Python SDK - async/sync client for Infrahub infrastructure management.
77
```bash
88
uv sync --all-groups --all-extras # Install all deps
99
uv run invoke format # Format code
10-
uv run invoke lint # Lint (ruff + mypy + yamllint)
10+
uv run invoke lint # All linters (code + yamllint + documentation)
1111
uv run pytest tests/unit/ # Unit tests
1212
uv run pytest tests/integration/ # Integration tests
1313
```
1414

15-
## Tech Stack
15+
## Tech stack
1616

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

19-
## Code Pattern
19+
## Code pattern
2020

2121
```python
2222
# Always provide both async and sync versions
@@ -27,7 +27,7 @@ node = await client.get(kind="NetworkDevice")
2727
await node.save()
2828
```
2929

30-
## Project Structure
30+
## Project structure
3131

3232
```text
3333
infrahub_sdk/
@@ -38,7 +38,7 @@ infrahub_sdk/
3838
└── pytest_plugin/ # Custom pytest plugin
3939
```
4040

41-
## Markdown Style
41+
## Markdown style
4242

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

@@ -52,7 +52,7 @@ Key rules:
5252

5353
**Always**
5454

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

72-
## Subdirectory Guides
72+
## Subdirectory guides
7373

7474
- [docs/AGENTS.md](docs/AGENTS.md) - Documentation (Docusaurus)
7575
- [infrahub_sdk/ctl/AGENTS.md](infrahub_sdk/ctl/AGENTS.md) - CLI development

tasks.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,14 @@ def lint_vale(context: Context) -> None:
218218
context.run(exec_cmd)
219219

220220

221+
@task
222+
def lint_code(context: Context) -> None:
223+
"""Run all code linters."""
224+
lint_ruff(context)
225+
lint_ty(context)
226+
lint_mypy(context)
227+
228+
221229
@task
222230
def lint_docs(context: Context) -> None:
223231
"""Run all documentation linters."""
@@ -229,9 +237,7 @@ def lint_docs(context: Context) -> None:
229237
def lint_all(context: Context) -> None:
230238
"""Run all linters."""
231239
lint_yaml(context)
232-
lint_ruff(context)
233-
lint_ty(context)
234-
lint_mypy(context)
240+
lint_code(context)
235241
lint_docs(context)
236242

237243

0 commit comments

Comments
 (0)