◐ Shell
clean mode source ↗

lint: switch Black with `ruff-format` by Borda · Pull Request #1865 · gitpython-developers/GitPython

Expand Up @@ -495,9 +495,8 @@ def refresh(cls, path: Union[None, PathLike] = None) -> bool: if mode in quiet: pass elif mode in warn or mode in error: err = ( dedent( """\ err = dedent( """\ %s All git commands will error until this is rectified.
Expand All @@ -510,40 +509,35 @@ def refresh(cls, path: Union[None, PathLike] = None) -> bool: Example: export %s=%s """ ) % ( err, cls._refresh_env_var, "|".join(quiet), "|".join(warn), "|".join(error), cls._refresh_env_var, quiet[0], ) ) % ( err, cls._refresh_env_var, "|".join(quiet), "|".join(warn), "|".join(error), cls._refresh_env_var, quiet[0], )
if mode in warn: _logger.critical(err) else: raise ImportError(err) else: err = ( dedent( """\ err = dedent( """\ %s environment variable has been set but it has been set with an invalid value.
Use only the following values: - %s: for no message or exception - %s: for a warning message (logging level CRITICAL, displayed by default) - %s: for a raised exception """ ) % ( cls._refresh_env_var, "|".join(quiet), "|".join(warn), "|".join(error), ) ) % ( cls._refresh_env_var, "|".join(quiet), "|".join(warn), "|".join(error), ) raise ImportError(err)
Expand All @@ -565,13 +559,11 @@ def is_cygwin(cls) -> bool:
@overload @classmethod def polish_url(cls, url: str, is_cygwin: Literal[False] = ...) -> str: ... def polish_url(cls, url: str, is_cygwin: Literal[False] = ...) -> str: ...
@overload @classmethod def polish_url(cls, url: str, is_cygwin: Union[None, bool] = None) -> str: ... def polish_url(cls, url: str, is_cygwin: Union[None, bool] = None) -> str: ...
@classmethod def polish_url(cls, url: str, is_cygwin: Union[None, bool] = None) -> PathLike: Expand Down Expand Up @@ -932,8 +924,7 @@ def execute( command: Union[str, Sequence[Any]], *, as_process: Literal[True], ) -> "AutoInterrupt": ... ) -> "AutoInterrupt": ...
@overload def execute( Expand All @@ -942,8 +933,7 @@ def execute( *, as_process: Literal[False] = False, stdout_as_string: Literal[True], ) -> Union[str, Tuple[int, str, str]]: ... ) -> Union[str, Tuple[int, str, str]]: ...
@overload def execute( Expand All @@ -952,8 +942,7 @@ def execute( *, as_process: Literal[False] = False, stdout_as_string: Literal[False] = False, ) -> Union[bytes, Tuple[int, bytes, str]]: ... ) -> Union[bytes, Tuple[int, bytes, str]]: ...
@overload def execute( Expand All @@ -963,8 +952,7 @@ def execute( with_extended_output: Literal[False], as_process: Literal[False], stdout_as_string: Literal[True], ) -> str: ... ) -> str: ...
@overload def execute( Expand All @@ -974,8 +962,7 @@ def execute( with_extended_output: Literal[False], as_process: Literal[False], stdout_as_string: Literal[False], ) -> bytes: ... ) -> bytes: ...
def execute( self, Expand Down Expand Up @@ -1387,8 +1374,9 @@ def __call__(self, **kwargs: Any) -> "Git": return self
@overload def _call_process(self, method: str, *args: None, **kwargs: None) -> str: ... # If no args were given, execute the call with all defaults. def _call_process( self, method: str, *args: None, **kwargs: None ) -> str: ... # If no args were given, execute the call with all defaults.
@overload def _call_process( Expand All @@ -1398,14 +1386,12 @@ def _call_process( as_process: Literal[True], *args: Any, **kwargs: Any, ) -> "Git.AutoInterrupt": ... ) -> "Git.AutoInterrupt": ...
@overload def _call_process( self, method: str, *args: Any, **kwargs: Any ) -> Union[str, bytes, Tuple[int, Union[str, bytes], str], "Git.AutoInterrupt"]: ... ) -> Union[str, bytes, Tuple[int, Union[str, bytes], str], "Git.AutoInterrupt"]: ...
def _call_process( self, method: str, *args: Any, **kwargs: Any Expand Down