test(tools): add test suite for check_conventions #1569

Closed
Kikoarl wants to merge 1 commit from upstream-pr/1569 into main
Kikoarl commented 2026-10-08 12:47:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Kikoarl on 2026-10-08T12:47:20Z.


What

tools/check_conventions.py runs on every GitHub PR in the repository, checking Conventional Commits formatting, agent file bans, note restrictions, relative Markdown link resolution, library export formatting, and stub naming.

This adds a test suite in tools/tests/test_check_conventions.py covering:

  • Conventional commit subject parsing (valid types and scopes, rejection of unformatted subjects)
  • Agent and developer notes file restrictions
  • Markdown relative link validation
  • Library name extraction from header definitions
  • Function body extraction and basic stub detection heuristics

Can be run via standard unittest discovery: python3 -m unittest discover tools/tests.

Tested

  • Linux x86-64 (CachyOS, Python 3.13).
  • python3 -m unittest discover tools/tests passes 7/7 tests in 0.002s.
  • python3 tools/check_conventions.py --base origin/main passes.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4787016070 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1569). Originally posted by [Kikoarl](https://github.com/Kikoarl) on 2026-10-08T12:47:20Z. --- ### What `tools/check_conventions.py` runs on every GitHub PR in the repository, checking Conventional Commits formatting, agent file bans, note restrictions, relative Markdown link resolution, library export formatting, and stub naming. This adds a test suite in `tools/tests/test_check_conventions.py` covering: - Conventional commit subject parsing (valid types and scopes, rejection of unformatted subjects) - Agent and developer notes file restrictions - Markdown relative link validation - Library name extraction from header definitions - Function body extraction and basic stub detection heuristics Can be run via standard unittest discovery: `python3 -m unittest discover tools/tests`. ### Tested - Linux x86-64 (CachyOS, Python 3.13). - `python3 -m unittest discover tools/tests` passes 7/7 tests in 0.002s. - `python3 tools/check_conventions.py --base origin/main` passes. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
oneandonlydean commented 2026-10-09 08:52:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T08:52:58Z.


Closing: these tests pin what check_conventions.py does today, with no change behind them, and nothing in CI runs them. Tests go in together with the fix they cover.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6077679770 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1569#issuecomment-6077679770). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T08:52:58Z. --- Closing: these tests pin what `check_conventions.py` does today, with no change behind them, and nothing in CI runs them. Tests go in together with the fix they cover.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!1569
No description provided.