Skip to content

fix typing for get_auto_imports, get_namespace, and run_formatters #2674

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

Merged
merged 6 commits into from
May 11, 2025

Conversation

BlaackWizard
Copy link
Contributor

Fixed type hints for run_formatter method. Added type hints for get_auto_imports and get_namespace methods

Format is:

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@@ -18,4 +19,6 @@ def get_command_line_option(argv: Sequence[Any], option: Any) -> Any | None: ...
def normalize_path_patterns(patterns: Iterable[str]) -> list[str]: ...
def is_ignored_path(path: StrPath, ignore_patterns: Iterable[str]) -> bool: ...
def find_formatters() -> dict[str, str | None]: ...
def run_formatters(written_files: Sequence[StrOrBytesPath], black_path: str = ...) -> None: ...
def run_formatters(
written_files: Sequence[StrOrBytesPath], black_path: str = ..., stderr: object = sys.stderr
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, also make sure that import _typeshed is there

Suggested change
written_files: Sequence[StrOrBytesPath], black_path: str = ..., stderr: object = sys.stderr
written_files: Sequence[StrOrBytesPath], black_path: str = ..., stderr: _typeshed.SupportsWrite[str] = ...,

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@sobolevn sobolevn merged commit 676509a into typeddjango:master May 11, 2025
37 checks passed
jose-reveni pushed a commit to jose-reveni/django-stubs that referenced this pull request Jun 9, 2025
…ypeddjango#2674)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: sobolevn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Fix django.core.management for 5.2
2 participants