Add type stubs for core analysis modules - #288
Open
heejaechang wants to merge 2 commits into
Open
Conversation
Bundle complete sidecar stubs for visitors, raw metrics, complexity, and maintainability metrics, and include them in legacy package builds. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Distinguish operator names from AST operands, model hashable stored operand values, and narrow dispatch descriptor ownership to HalsteadVisitor subclasses. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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
radon.visitors,radon.raw,radon.complexity, andradon.metricsThis is intentionally a partial typing contribution. The Mando-decorated CLI, harvesters, contrib plugin, and bundled tests remain untyped rather than being weakened or padded for a score.
Type completeness
Installed-wheel, unfiltered
pyright --verifytypes radon --outputjson(no--ignoreexternal):The two touched exports that remain unknown are the faithfully exposed stdlib
operatormodule reexports inradon.rawandradon.visitors; they are not authoredAnyescape hatches.Validation
mypy.stubtestpasses without allowlists or exclusions.pyifiles pluspy.typedAny, casts, ignores,noqa, checker disables, or allowlistsFollow-up contract audit
operands_seenasHashableand descriptor ownership astype[HalsteadVisitor]get_name(object)because runtime only readsobj.__class__.__name__from_code/from_ast: ParamSpec can follow subclass constructors only by falsely adding positional arguments that the runtime factories rejectExisting boundaries
Full-package stubtest still stops before checking because untouched CLI/tests contain the existing untyped Mando import,
tomllib/tomliredefinition, and bundled-test annotation errors. Twine still reports the existing READMErawdirective error. Existing repository-wide flake8/pep8/pylint failures and the obsoletemake formattool arguments are unchanged; the added stubs pass targeted isort and Black checks.