Repository navigation
Q1-06: types in every module - #484
Merged
Merged
Conversation
Prepared with AI assistance.
mypy now checks every module except reframe.core.commands, which comes off the list once Q1-05 has split it. The 108 errors in the 24 other modules are fixed with annotations, None checks and renamed reused names; what the code does is unchanged. Two real faults the types turned up, each with a test: - preflight accepted an AWS sign-in that named no account, and the graph check then used "None" as the account - the reports store returned no bucket if its Terraform root did not report one, and uploads went to s3://None; it now stops Prepared with AI assistance.
Prepared with AI assistance.
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.
Story #483, part of #449 (Credibility: code quality).
mypynow checks every module exceptreframe.core.commands, which comes off the list once Q1-05 (#454) has split it. The override list inpyproject.tomlgoes from 25 modules to 1.What changed
assertstates it with a comment, for example "with create, loader returns the loader or stops".design/flow.pyreplaces the(re.search(...) or [None, ""])[1]idiom with a small_first()helper.Real faults the types turned up, each fixed with a test that fails on the old code
core/preflight.py: an AWS sign-in whose identity named no account passed preflight, and the graph check then used"None"as the account in its policy simulation. Preflight now lists it as a problem with the sign-in command.report/store.py:ensure()returnedNoneif the reports Terraform root did not report its bucket, and uploads would go tos3://None/.... It now stops with a clear message.Checks, run locally as CI runs them
ruff check src tests: passes.mypy: no issues in 89 source files.Prepared with AI assistance.