Skip to content

Commit 9646845

Browse files
committed
Make capitilasion
1 parent 42f2507 commit 9646845

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

AGENTS.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ These three documents define the patterns this codebase already uses. Generating
3131
| Topic | Doc |
3232
|---|---|
3333
| `list_*` methods, pagination, iterator vs list, the `_list` helper | [`docs/ITERATORS.md`](docs/ITERATORS.md) |
34-
| Pydantic model conventions: `ConfigDict`, aliases, validators, relationships, exporting | [`docs/models.md`](docs/models.md) |
35-
| Resource service patterns: method shape, JSON:API envelopes, client wiring, examples | [`docs/resource.md`](docs/resource.md) |
34+
| Pydantic model conventions: `ConfigDict`, aliases, validators, relationships, exporting | [`docs/MODELS.md`](docs/MODELS.md) |
35+
| Resource service patterns: method shape, JSON:API envelopes, client wiring, examples | [`docs/RESOURCE.md`](docs/RESOURCE.md) |
3636

3737
Each doc ends with a checklist. Use those checklists; they encode the rules a reviewer will look for.
3838

@@ -52,7 +52,7 @@ A handful of conventions are pervasive enough that you'll regret breaking them.
5252

5353
1. **`list_*` methods return `Iterator[X]`.** Not `list[X]`, not `Iterable[X]`, not a custom `Pager`. Use `for item in self._list(path): yield ...` inside the method body. ([ITERATORS.md](docs/ITERATORS.md))
5454

55-
2. **JSON:API attribute names go through `Field(alias="...")`.** The API sends `created-at`, Python uses `created_at`. Pair with `model_config = ConfigDict(populate_by_name=True, validate_by_name=True)` on the model. ([models.md](docs/models.md))
55+
2. **JSON:API attribute names go through `Field(alias="...")`.** The API sends `created-at`, Python uses `created_at`. Pair with `model_config = ConfigDict(populate_by_name=True, validate_by_name=True)` on the model. ([MODELS.md](docs/MODELS.md))
5656

5757
3. **`model_dump(by_alias=True, exclude_none=True)` for write payloads.** Without `by_alias=True` you'll send snake_case to the API and it will silently drop the fields. Add `mode="json"` if the options contain enums.
5858

@@ -89,7 +89,7 @@ When in doubt about whether a change is breaking: check `gh search code '<symbol
8989

9090
This is the workflow that produces low-friction reviews. Follow it.
9191

92-
1. **Understand the scope first.** If the task is "add resource X", read `docs/resource.md` end-to-end. If it's "fix bug in Y", read `Y`'s current implementation and tests before touching anything.
92+
1. **Understand the scope first.** If the task is "add resource X", read `docs/RESOURCE.md` end-to-end. If it's "fix bug in Y", read `Y`'s current implementation and tests before touching anything.
9393
2. **Check official API docs and go-tfe for the canonical API shape.** `pytfe` mirrors the HCP Terraform API and often follows go-tfe's surface. URL paths, method names, payload shapes, response shapes, enum values, and redirect behavior should be verified against https://developer.hashicorp.com/terraform/cloud-docs/api-docs and https://github.com/hashicorp/go-tfe before designing anything.
9494
3. **Add models first** (`src/pytfe/models/<resource>.py`), then the resource (`src/pytfe/resources/<resource>.py`), then wire both into the respective `__init__.py` / `client.py`.
9595
4. **Write tests.** Mock `HTTPTransport`. One test per method, plus an invalid-id case for every public method. See `tests/units/test_comment.py` as a small reference.
@@ -133,4 +133,4 @@ A reasonable PR includes:
133133

134134
Open the PR with a description that explains *why* the change is needed, links to any HCP Terraform API docs or go-tfe code referenced, and notes any behavior changes a downstream consumer might see.
135135

136-
The reviewer's checklist will be the union of the checklists in [`docs/ITERATORS.md`](docs/ITERATORS.md), [`docs/models.md`](docs/models.md), and [`docs/resource.md`](docs/resource.md). Pre-running them yourself is the fastest way to a merge.
136+
The reviewer's checklist will be the union of the checklists in [`docs/ITERATORS.md`](docs/ITERATORS.md), [`docs/MODELS.md`](docs/MODELS.md), and [`docs/RESOURCE.md`](docs/RESOURCE.md). Pre-running them yourself is the fastest way to a merge.
File renamed without changes.

docs/resource.md renamed to docs/RESOURCE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This is internal reference for adding or editing resource services in `src/pytfe
44

55
Companion docs you'll need alongside this one:
66

7-
- [models.md](models.md) — how to define the Pydantic models the resource takes and returns
7+
- [MODELS.md](MODELS.md) — how to define the Pydantic models the resource takes and returns
88
- [ITERATORS.md](ITERATORS.md) — how `list_*` methods are shaped
99
- The [examples/](../examples) directory — runnable demos for each resource
1010

@@ -284,7 +284,7 @@ If you added new models (almost always yes), wire them through:
284284
1. Import them alphabetically in the right section block.
285285
2. Add their names to the `__all__` list at the bottom.
286286

287-
If your models use forward references, add a `Model.model_rebuild(...)` call at the bottom — see [models.md](models.md).
287+
If your models use forward references, add a `Model.model_rebuild(...)` call at the bottom — see [MODELS.md](MODELS.md).
288288

289289
## Tests
290290

@@ -462,7 +462,7 @@ raise InvalidWidgetIDError() # preferred for new APIs
462462
- [ ] Non-standard response shapes (`204`, `null`, bare resources, raw bytes, redirects) are verified against docs/go-tfe/spec and covered by tests
463463
- [ ] Presigned upload/download/blob URLs are fetched with `include_auth=False`
464464
- [ ] Classes with `def list(...)` avoid later bare `list[...]` annotations
465-
- [ ] Models added per [models.md](models.md), wired in `models/__init__.py`
465+
- [ ] Models added per [MODELS.md](MODELS.md), wired in `models/__init__.py`
466466
- [ ] Resource wired into `client.py` (import + `self.widgets = Widgets(...)`)
467467
- [ ] Unit tests in `tests/units/test_widget.py`, including invalid-id cases and at least one happy-path per method
468468
- [ ] Example in `examples/widget.py` (or extension to existing file), with env-var auth, cleanup, and `_print_header`

0 commit comments

Comments
 (0)