fix(ci): run mypy on all example files not just top-level in projects - #167
Merged
Conversation
The test workflow ran `mypy ./**/*.py`, but `**` only recurses when the shell has `globstar` enabled — which it is NOT in the non-interactive shell CI uses. So `./**/*.py` expanded to just the two top-level files (`src/__init__.py`, `tests/__init__.py`) and mypy silently skipped every example under `src/blocks/` (and nested tests). CI reported 'no issues found in 2 source files' while type-checking none of the actual examples. Use `mypy .` so mypy walks the tree itself instead of relying on shell globbing. Coverage goes from 2 files to all of them (e.g. block-kit: 2 -> 32); still passes on all collections. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.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.
Problem
The test workflow's type-check step is
mypy ./**/*.py. But**only recurses when the shell hasglobstarenabled — and it is not enabled in the non-interactive shell GitHub Actions uses. So./**/*.pyexpands to only the two top-level files (src/__init__.py,tests/__init__.py), and mypy silently skips every example undersrc/blocks/and the nested tests.You can see it in any recent run's log:
2 files — while the collection has many more (block-kit has 32
.pyfiles). Type errors in the actual examples would pass CI unnoticed.Fix
mypy .walks the directory tree itself rather than relying on shell globbing, so it checks every file regardless ofglobstar.Verification
Ran
mypy .per collection (the matrix runs the step in eachshowcasedir):All collections still pass — main is type-clean; CI just wasn't actually checking it.
🤖 Generated with Claude Code