Skip to content

Check directly declared method signatures on selected classes - #117

Merged
TristanKruse merged 4 commits into
mainfrom
feature/declared-method-signatures-105
Nov 28, 2026
Merged

TristanKruse merged 4 commits into
mainfrom
feature/declared-method-signatures-105

Conversation

@TristanKruse

@TristanKruse TristanKruse commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #105

Scope

Delivers the declared-here milestone. project_classes.in_namespace(...).should.declare_method(shape) requires each selected class to directly declare a method that accepts the specified call shape. It checks instance or singleton scope, positional arity, keyword arguments, and optional explicit block capture. It does not resolve inherited or mixed-in methods, aliases, visibility, or runtime-generated methods.

Confirmed missing or incompatible declarations can be baselined. Unknown selections and conflicting declarations fail the check and reject both creating and applying a baseline. Matching and baseline identities preserve Ruby identifier encodings.

Verification

  • Local: 1,034 examples, zero failures, 13 platform skips. Lint, generated docs, and installed-gem red-to-green smoke tests passed.
  • GitHub Actions: Ruby 3.3 and 3.4 on Linux, Ruby 4.0 on Windows, Ubuntu quality/package, the RAG fixture, dependency security, and real-world canaries passed.
  • Declaration facts are opt-in and shared across rules. In the Windows fixture (20 rules, 500 files), one shared inventory used 560k median allocations vs 2.24M when rebuilding for each rule.

The selector foundation shipped separately in #116. Effective method lookup is a distinct follow-up, not part of this rule.

@TristanKruse
TristanKruse changed the base branch from feature/declaration-facts-103 to main November 28, 2026 16:32
@TristanKruse
TristanKruse marked this pull request as ready for review November 28, 2026 16:32
@TristanKruse
TristanKruse merged commit 384eab3 into main Nov 28, 2026
20 of 31 checks passed
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.

Rules: support bounded method/signature protocols with explicit unknown semantics

1 participant