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
23 changes: 22 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,28 @@ one mistake that silently removes a test, are in
[WRITING.md](WRITING.md#documented-examples-that-run).

Use the [test bite gate](../REVIEW.md#4-test-bite) to prove a regression
fails for the reason it claims to catch.
fails for the reason it claims to catch. For bug fixes and behavioral
changes, verify new or updated `pytest` regressions fail inside the real
owner call when modified production files are restored to `<base>` and
newly added production files are removed temporarily:

```console
$ mapfile -t mod_py < <(
git diff --name-only -M --diff-filter=MDR <base>..HEAD -- '*.py' |
rg -v '(^|/)tests?/|(^|/)conftest\.py$|(^|/)test_[^/]*\.py$|_test\.py$'
) &&
mapfile -t add_py < <(
git diff --name-only -M --diff-filter=A <base>..HEAD -- '*.py' |
rg -v '(^|/)tests?/|(^|/)conftest\.py$|(^|/)test_[^/]*\.py$|_test\.py$'
) &&
test $(( ${#mod_py[@]} + ${#add_py[@]} )) -gt 0 &&
{ [ "${#mod_py[@]}" -eq 0 ] ||
git restore --source=<base> --worktree -- "${mod_py[@]}"; } &&
{ [ "${#add_py[@]}" -eq 0 ] || rm -f -- "${add_py[@]}"; } &&
! uv run pytest -x &&
git restore --source=HEAD --worktree -- "${mod_py[@]}" "${add_py[@]}" &&
uv run pytest
```

### Clean-room provenance

Expand Down
26 changes: 26 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!--
Open an issue before sending behavioral or API pull requests. Read REVIEW.md,
.github/CONTRIBUTING.md, and:
- https://github.com/tmux-python/.github/blob/HEAD/AI_POLICY.md
- https://github.com/tmux-python/.github/blob/HEAD/WRITING.md
Use N/A where a prompt does not apply (docs-only, lockfile bump, pure refactor).
-->

Closes # <!-- or N/A for docs, lockfile bump, or pure refactor -->

### 1. Owner and boundary

- Rule changed and module that owns it:
- Sibling entry points checked (`sync`/`async`, CLI/API, single/batch, or `N/A`):
- Why this belongs here (owner fix, boundary adapter, or single-PR ownership transfer):

### 2. Failure before the fix (`N/A` for docs, lockfile bumps, or pure refactors)

- Baseline (`<base>` commit, or `<pre_fix_head>` SHA if fixing a defect introduced in this PR):
- Failing input or command and observed failure before the fix:

### 3. Verification and tool disclosure

- Gates run (plus production-only revert check for behavioral fixes, or `N/A`):
- `.github/workarounds.toml` updates (`None` if none):
- Tool use:
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
run: uv run ruff format --check .
- name: Check types with ty
run: uv run ty check --python-version ${{ matrix.python-version }} --output-format github
- name: Check declared workarounds
run: PYTHONDONTWRITEBYTECODE=1 uv run python -B scripts/check_workarounds.py
- name: Tests (pytest)
if: matrix.python-version != '3.14'
run: uv run pytest -m ""
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ extend-select = [
"PT", # flake8-pytest-style
"RET", # flake8-return
"FURB", # refurb
"PGH003", # specific type-ignore codes
"PGH004", # specific noqa codes
]
ignore = [
"COM812", # missing trailing comma, ruff format conflict
Expand Down
Loading
Loading