Add comprehensive function definition × call catalog - #6
Open
ekohilas wants to merge 3 commits into
Open
Conversation
Introduce a verdict-free, tag-annotated catalog of the ways a Python function can be defined and called, as the shared test-case corpus for the argument lint rules. Each case pairs a definition snippet with a call snippet and tags it along orthogonal dimensions; a human decides per rule which combinations should violate. - catalog/_schema.py: Case dataclass, controlled vocabulary, validate() - catalog/README.md: authoring contract for concurrent extension - test/test_catalog.py: structural validation (parses, unique ids, schema), records (not asserts) inferability + plugin behaviour - pyproject.toml: pytest pythonpath for the catalog package - populated categories so far: param_kinds, defaults_and_annotations, callable_kinds, unpacking, arg_forms, call_target_forms Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LRN8aXwbrHyqZ15QyZHSFM
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LRN8aXwbrHyqZ15QyZHSFM
Full function definition×call catalog now populated across 9 categories (232 tag-annotated, verdict-free cases). All 467 structural checks pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LRN8aXwbrHyqZ15QyZHSFM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a comprehensive, verdict-free catalog of Python function definitions and calls. The catalog serves as a shared test-case corpus for argument-related lint rules, organizing cases along orthogonal dimensions (parameter kinds, callable kinds, argument forms, etc.) without prescribing pass/fail verdicts.
Key Changes
New
catalog/package with 8 category modules covering distinct aspects of function definitions and calls:param_kinds.py— parameter shapes (positional-only, keyword-only, *args, **kwargs, etc.)callable_kinds.py— callable types (module functions, methods, classmethods, lambdas, properties, etc.)arg_forms.py— argument expressions at call sites (literals, variables, attributes, unpacking, etc.)unpacking.py— iterable/mapping unpacking (*seq, **mapping) and inferabilityarity_and_ordering.py— argument count and ordering (exact, defaults-omitted, too-few, reordered, etc.)call_target_forms.py— how callables are referenced (bare names, attributes, subscripts, etc.)source_and_inferability.py— definition source and astroid inference capabilitydefaults_and_annotations.py— parameter defaults and type annotationscross_cutting.py— combinations that span multiple axes (redundant keywords, shadowing builtins, etc.)Schema and validation (
_schema.py):Casedataclass pairing definition and call snippets with dimension tagsvalidate()function for structural integrity checksmarked_source()helper for astroid node extractionTest harness (
test/test_catalog.py):Documentation (
catalog/README.md):Configuration (
pyproject.toml):catalogpackage importable during testsNotable Design Details
arg_forms.pyvaries argument expressions while keeping signature shape, source, and inferability constant).https://claude.ai/code/session_01LRN8aXwbrHyqZ15QyZHSFM