Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions scripts/make_pyi.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ def _get_changed_files() -> list[Path] | None:
changed_files = _git_changed_files([f"{last_run_commit_sha}..HEAD"])
# get all unstaged changes
changed_files.extend(_git_changed_files())
# also pick up staged-but-uncommitted changes — pre-commit aligns the
# worktree with the index, so without this they'd be invisible to the
# diffs above and the corresponding .pyi files would not be regenerated.
changed_files.extend(_git_changed_files(["--cached"]))
Comment thread
FarhanAliRaza marked this conversation as resolved.
changed_files = list(dict.fromkeys(changed_files))
if _relative_to_pwd(GENERATOR_FILE) not in changed_files:
return changed_files
logger.info("make_pyi.py has changed, checking diff now")
Expand Down
Loading