-
-
Notifications
You must be signed in to change notification settings - Fork 150
Fix missing type stubs error from pyright #1404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
/pyright_strict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few questions and comments.
FYI @cmp0xff A good thing to note. If |
/pyright_strict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Dr-Irv !
I asked GitHub copilot to make a shell script to create #!/usr/bin/env bash
# Minimalist helpers for creating __init__.pyi files
# - subdirs DIR -> prints direct subdirectories (one per line)
# - ensure_init FILE -> creates FILE if missing (empty)
# - mkinit_pyi_recursive DIR -> ensures __init__.pyi in DIR and all subdirs
set -eu
# List direct subdirectories of a directory, robust with spaces/newlines
subdirs() {
local dir=${1:-.}
# use find with -mindepth 1 -maxdepth 1 -type d and print0 to handle names safely
find "$dir" -mindepth 1 -maxdepth 1 -type d -print0 | while IFS= read -r -d '' d; do
printf '%s\n' "$d"
done
}
# Create __init__.pyi if it doesn't exist
ensure_init() {
local f=$1
if [ ! -e "$f" ]; then
: > "$f"
fi
}
# Recursively create __init__.pyi in DIR and its direct subdirectories (depth-first)
mkinit_pyi_recursive() {
local dir=${1:-.}
printf '%s\n' "$dir"
# ensure the init file in this dir
ensure_init "$dir/__init__.pyi"
# iterate direct subdirectories
subdirs "$dir" | while IFS= read -r sub; do
mkinit_pyi_recursive "$sub"
done
}
# If the script is invoked, run the recursive function on given path(s)
if [ "${BASH_SOURCE[0]}" = "$0" ]; then
if [ $# -eq 0 ]; then
mkinit_pyi_recursive .
else
for p in "$@"; do
mkinit_pyi_recursive "$p"
done
fi
fi |
There were 9 places where
reportMissingTypeStubs
came up, so this PR makes that issue go away