Skip to content

Add file-scoped named method call restrictions - #115

Merged
TristanKruse merged 1 commit into
mainfrom
feature/named-calls-104
Nov 27, 2026
Merged

TristanKruse merged 1 commit into
mainfrom
feature/named-calls-104

Conversation

@TristanKruse

Copy link
Copy Markdown
Collaborator

Closes #104 for the file-scoped syntactic MVP. Use should_not.contain_calls_named(:delete_all) or an array of exact names; optional NamedCallOptions receiver: :bare ignores explicitly received calls including self. This is not receiver inference, dynamic dispatch, or method protocol checking. CLI JSON includes the file, written method, receiver form, safe navigation and byte coordinates. Baselines accept at most the recorded number of occurrences for each file/name/form, not new duplicates. A shared source-only inventory avoids re-parsing per rule and leaves dependency graphs unchanged. CI covers both the source checkout and built gem. The updated semantic probes distinguish read vs delete_all with the same file dependency. Independent of #114 (merge-tree clean). Local Windows Ruby 4.0.6, five alternating trials on 300 generated files: 25 named checks in 171 ms with reuse vs 2,531 ms forcing a source pass before every rule; about 135 KiB extra retained heap after GC. Ordinary 25-rule graph checks observed 217 vs 222 ms with unchanged allocations; gem-load medians 456 vs 467 ms. These are fixture measurements, not platform-wide performance claims.

@TristanKruse
TristanKruse merged commit a05ae71 into main Nov 27, 2026
18 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: add explicit syntactic named-method-call restrictions

1 participant