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
5 changes: 4 additions & 1 deletion .agents/rules/pr.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ Before drafting any pull request description, strictly adhere to the rules in

## Commit & PR Types
* `fix:` / `feat:`: User-visible changes ONLY.
* `tests:`: Test-only changes and test-helper fixes (never `fix:` or `fix(tests):`).
* `workflow:` / `workflows:`: Internal workflow automation, release tooling, and
CI scripts (e.g., `workflow(release): ...`).
* `tests:`: Test-only changes and test-helper fixes (never `fix:` or
`fix(tests):`).

## PR Commit Workflow Invariant
* Once a Pull Request is created, always make new commits or merge commits.
Expand Down
13 changes: 11 additions & 2 deletions .agents/rules/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,24 @@
* Use direct attribute access (e.g. `args.foo`) on `argparse.Namespace` with
well-defined shapes. Avoid defensive `getattr()`.

## Exception Handling
* Inherit custom exceptions from `Exception`, not `RuntimeError`.

## Subprocess
* Demarcate captured stdout/stderr in exceptions with 20 `=` characters:
`==================== STDOUT BEGIN ====================` /
`==================== STDOUT END ====================` (same for STDERR).

## TypedDict
* **External Objects**: When defining a `TypedDict` for an external object,
link to its definition in the docstring.

## Type Checking & Annotations
* **`importlib.metadata` `PackagePath`**: `f.locate()` is typed as `PathLike`.
Wrap with `pathlib.Path(f.locate())` to call `.exists()`, `.is_file()`, etc.
* **In-file disables vs target skipping**: Prefer `# pyrefly: ignore[<error-code>]`
(e.g. `[missing-import]`) over `tags = ["no-pyrefly"]`.
* **In-file disables vs target skipping**: Prefer
`# pyrefly: ignore[<error-code>]` (e.g. `[missing-import]`) over
`tags = ["no-pyrefly"]`.
* **No blanket ignores**: NEVER use bare `# type: ignore` or literal
`# type: ignore[...]`. Use error-specific ignores instead.
* **Ignore comments**: When adding `# pyrefly: ignore[...]` or type
Expand Down