Skip to content

code_health: class-size and include-layering checks, base from upstream merge-base - #70

Merged
dayfine merged 4 commits into
mainfrom
devtools/code-health-rules
Oct 30, 2026
Merged

dayfine merged 4 commits into
mainfrom
devtools/code-health-rules

Conversation

@dayfine

@dayfine dayfine commented Oct 30, 2026

Copy link
Copy Markdown
Owner

The incremental check compared against whatever --base-ref we passed, and a stale fork main made upstream changes look like ours. Without --base-ref it now uses the merge-base with upstream/main (falling back to origin/main) and prints it. It also adds class checks in the same incremental style (a single pure-virtual-method interface should be a callable, at most 7 public methods, no public mutable data in classes with methods) and fails new includes of game modules from Common/, CommonFramework/ and CommonTools/. Checker tests pass (41); run against #59, #61, #66, #67 and the last 20 upstream commits, it flagged only real growth, e.g. OverworldMap in #67 with 20 public methods.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E

dayfine and others added 4 commits October 29, 2026 21:57
Comparing with a stale fork main reported upstream changes as the
branch's own. Without --base-ref, use git merge-base HEAD upstream/main
(origin/main when there is no upstream remote) and print the base used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Count public methods (limit 7, advisory above 5), public non-static data
in classes with mutating methods, and single-method interfaces, with a
lexical member scan over lizard's tokens. Classes are compared with the
base like functions, so only new violations and growth fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Fail when a change adds an #include of Pokemon/, PokemonBDSP/ or
VideoGames/ to Common, CommonFramework or CommonTools. config.py lists
game and platform top-level directories; a test keeps the list complete.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Runs over origin/main~20..main reported legacy classes far over the
public-method limit as advisory, and a public const type field as
mutable data. Advise only for 6-7 methods and exempt const fields.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
@dayfine
dayfine marked this pull request as ready for review October 30, 2026 05:05
@dayfine
dayfine merged commit 4aa1551 into main Oct 30, 2026
14 checks passed
@dayfine
dayfine deleted the devtools/code-health-rules branch October 30, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant