Skip to content

Commit 089656f

Browse files
authored
Merge pull request #815 from opsmill/pog-lint-code-task
Add invoke command specifically for code linting
2 parents 497bad1 + 878683b commit 089656f

2 files changed

Lines changed: 17 additions & 10 deletions

File tree

AGENTS.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ 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)
11+
uv run invoke lint-code # All linters for Python code
1112
uv run pytest tests/unit/ # Unit tests
1213
uv run pytest tests/integration/ # Integration tests
1314
```
1415

15-
## Tech Stack
16+
## Tech stack
1617

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

19-
## Code Pattern
20+
## Code pattern
2021

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

30-
## Project Structure
31+
## Project structure
3132

3233
```text
3334
infrahub_sdk/
@@ -38,7 +39,7 @@ infrahub_sdk/
3839
└── pytest_plugin/ # Custom pytest plugin
3940
```
4041

41-
## Markdown Style
42+
## Markdown style
4243

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

@@ -52,7 +53,7 @@ Key rules:
5253

5354
**Always**
5455

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

72-
## Subdirectory Guides
73+
## Subdirectory guides
7374

7475
- [docs/AGENTS.md](docs/AGENTS.md) - Documentation (Docusaurus)
7576
- [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)