| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ebcfced commit b070e93
10 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -147,7 +147,7 @@ def refresh(path: Optional[PathLike] = None) -> None: | |||
| 147 | 147 | if not Git.refresh(path=path): | |
| 148 | 148 | return | |
| 149 | 149 | if not FetchInfo.refresh(): # noqa: F405 | |
| 150 | - return # type: ignore [unreachable] | ||
| 150 | + return # type: ignore[unreachable] | ||
| 151 | 151 | ||
| 152 | 152 | GIT_OK = True | |
| 153 | 153 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -172,7 +172,7 @@ def pump_stream( | |||
| 172 | 172 | p_stdout = process.proc.stdout if process.proc else None | |
| 173 | 173 | p_stderr = process.proc.stderr if process.proc else None | |
| 174 | 174 | else: | |
| 175 | - process = cast(Popen, process) # type: ignore [redundant-cast] | ||
| 175 | + process = cast(Popen, process) # type: ignore[redundant-cast] | ||
| 176 | 176 | cmdline = getattr(process, "args", "") | |
| 177 | 177 | p_stdout = process.stdout | |
| 178 | 178 | p_stderr = process.stderr | |
@@ -215,7 +215,7 @@ def pump_stream( | |||
| 215 | 215 | error_str = error_str.encode() | |
| 216 | 216 | # We ignore typing on the next line because mypy does not like the way | |
| 217 | 217 | # we inferred that stderr takes str or bytes. | |
| 218 | - stderr_handler(error_str) # type: ignore | ||
| 218 | + stderr_handler(error_str) # type: ignore[arg-type] | ||
| 219 | 219 | ||
| 220 | 220 | if finalizer: | |
| 221 | 221 | finalizer(process) | |
@@ -1244,9 +1244,9 @@ def communicate() -> Tuple[AnyStr, AnyStr]: | |||
| 1244 | 1244 | if output_stream is None: | |
| 1245 | 1245 | stdout_value, stderr_value = communicate() | |
| 1246 | 1246 | # Strip trailing "\n". | |
| 1247 | - if stdout_value.endswith(newline) and strip_newline_in_stdout: # type: ignore | ||
| 1247 | + if stdout_value.endswith(newline) and strip_newline_in_stdout: # type: ignore[arg-type] | ||
| 1248 | 1248 | stdout_value = stdout_value[:-1] | |
| 1249 | - if stderr_value.endswith(newline): # type: ignore | ||
| 1249 | + if stderr_value.endswith(newline): # type: ignore[arg-type] | ||
| 1250 | 1250 | stderr_value = stderr_value[:-1] | |
| 1251 | 1251 | ||
| 1252 | 1252 | status = proc.returncode | |
@@ -1256,7 +1256,7 @@ def communicate() -> Tuple[AnyStr, AnyStr]: | |||
| 1256 | 1256 | stdout_value = proc.stdout.read() | |
| 1257 | 1257 | stderr_value = proc.stderr.read() | |
| 1258 | 1258 | # Strip trailing "\n". | |
| 1259 | - if stderr_value.endswith(newline): # type: ignore | ||
| 1259 | + if stderr_value.endswith(newline): # type: ignore[arg-type] | ||
| 1260 | 1260 | stderr_value = stderr_value[:-1] | |
| 1261 | 1261 | status = proc.wait() | |
| 1262 | 1262 | # END stdout handling | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -428,7 +428,11 @@ def trailers_list(self) -> List[Tuple[str, str]]: | |||
| 428 | 428 | List containing key-value tuples of whitespace stripped trailer information. | |
| 429 | 429 | """ | |
| 430 | 430 | cmd = ["git", "interpret-trailers", "--parse"] | |
| 431 | - proc: Git.AutoInterrupt = self.repo.git.execute(cmd, as_process=True, istream=PIPE) # type: ignore | ||
| 431 | + proc: Git.AutoInterrupt = self.repo.git.execute( # type: ignore[call-overload] | ||
| 432 | + cmd, | ||
| 433 | + as_process=True, | ||
| 434 | + istream=PIPE, | ||
| 435 | + ) | ||
| 432 | 436 | trailer: str = proc.communicate(str(self.message).encode())[0].decode("utf8") | |
| 433 | 437 | trailer = trailer.strip() | |
| 434 | 438 | ||
@@ -507,7 +511,7 @@ def _iter_from_process_or_stream(cls, repo: "Repo", proc_or_stream: Union[Popen, | |||
| 507 | 511 | if proc_or_stream.stdout is not None: | |
| 508 | 512 | stream = proc_or_stream.stdout | |
| 509 | 513 | elif hasattr(proc_or_stream, "readline"): | |
| 510 | - proc_or_stream = cast(IO, proc_or_stream) # type: ignore [redundant-cast] | ||
| 514 | + proc_or_stream = cast(IO, proc_or_stream) # type: ignore[redundant-cast] | ||
| 511 | 515 | stream = proc_or_stream | |
| 512 | 516 | ||
| 513 | 517 | readline = stream.readline | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -108,7 +108,7 @@ class Submodule(IndexObject, TraversableIterableObj): | |||
| 108 | 108 | k_default_mode = stat.S_IFDIR | stat.S_IFLNK | |
| 109 | 109 | """Submodule flags. Submodules are directories with link-status.""" | |
| 110 | 110 | ||
| 111 | - type: Literal["submodule"] = "submodule" # type: ignore | ||
| 111 | + type: Literal["submodule"] = "submodule" # type: ignore[assignment] | ||
| 112 | 112 | """This is a bogus type string for base class compatibility.""" | |
| 113 | 113 | ||
| 114 | 114 | __slots__ = ("_parent_commit", "_url", "_branch_path", "_name", "__weakref__") | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -391,7 +391,7 @@ def __contains__(self, item: Union[IndexObjUnion, PathLike]) -> bool: | |||
| 391 | 391 | return False | |
| 392 | 392 | ||
| 393 | 393 | def __reversed__(self) -> Iterator[IndexObjUnion]: | |
| 394 | - return reversed(self._iter_convert_to_object(self._cache)) # type: ignore | ||
| 394 | + return reversed(self._iter_convert_to_object(self._cache)) # type: ignore[call-overload] | ||
| 395 | 395 | ||
| 396 | 396 | def _serialize(self, stream: "BytesIO") -> "Tree": | |
| 397 | 397 | """Serialize this tree into the stream. Assumes sorted tree data. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -692,5 +692,13 @@ def traverse( | |||
| 692 | 692 | ||
| 693 | 693 | return cast( | |
| 694 | 694 | Union[Iterator[T_TIobj], Iterator[Tuple[Union[None, T_TIobj], T_TIobj]]], | |
| 695 | - super()._traverse(predicate, prune, depth, branch_first, visit_once, ignore_self, as_edge), # type: ignore | ||
| 695 | + super()._traverse( | ||
| 696 | + predicate, # type: ignore[arg-type] | ||
| 697 | + prune, # type: ignore[arg-type] | ||
| 698 | + depth, | ||
| 699 | + branch_first, | ||
| 700 | + visit_once, | ||
| 701 | + ignore_self, | ||
| 702 | + as_edge, | ||
| 703 | + ), | ||
| 696 | 704 | ) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -52,7 +52,7 @@ def iter_items( | |||
| 52 | 52 | # subclasses and recommends Any or "type: ignore". | |
| 53 | 53 | # (See: https://github.com/python/typing/issues/241) | |
| 54 | 54 | @classmethod | |
| 55 | - def delete(cls, repo: "Repo", *refs: "RemoteReference", **kwargs: Any) -> None: # type: ignore | ||
| 55 | + def delete(cls, repo: "Repo", *refs: "RemoteReference", **kwargs: Any) -> None: # type: ignore[override] | ||
| 56 | 56 | """Delete the given remote references. | |
| 57 | 57 | ||
| 58 | 58 | :note: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -387,8 +387,17 @@ def set_object( | |||
| 387 | 387 | # set the commit on our reference | |
| 388 | 388 | return self._get_reference().set_object(object, logmsg) | |
| 389 | 389 | ||
| 390 | - commit = property(_get_commit, set_commit, doc="Query or set commits directly") # type: ignore | ||
| 391 | - object = property(_get_object, set_object, doc="Return the object our ref currently refers to") # type: ignore | ||
| 390 | + commit = property( | ||
| 391 | + _get_commit, | ||
| 392 | + set_commit, # type: ignore[arg-type] | ||
| 393 | + doc="Query or set commits directly", | ||
| 394 | + ) | ||
| 395 | + | ||
| 396 | + object = property( | ||
| 397 | + _get_object, | ||
| 398 | + set_object, # type: ignore[arg-type] | ||
| 399 | + doc="Return the object our ref currently refers to", | ||
| 400 | + ) | ||
| 392 | 401 | ||
| 393 | 402 | def _get_reference(self) -> "SymbolicReference": | |
| 394 | 403 | """ | |
@@ -488,7 +497,11 @@ def set_reference( | |||
| 488 | 497 | ||
| 489 | 498 | # Aliased reference | |
| 490 | 499 | reference: Union["Head", "TagReference", "RemoteReference", "Reference"] | |
| 491 | - reference = property(_get_reference, set_reference, doc="Returns the Reference we point to") # type: ignore | ||
| 500 | + reference = property( # type: ignore[assignment] | ||
| 501 | + _get_reference, | ||
| 502 | + set_reference, # type: ignore[arg-type] | ||
| 503 | + doc="Returns the Reference we point to", | ||
| 504 | + ) | ||
| 492 | 505 | ref = reference | |
| 493 | 506 | ||
| 494 | 507 | def is_valid(self) -> bool: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -636,7 +636,7 @@ def _get_config_path(self, config_level: Lit_config_levels, git_dir: Optional[Pa | |||
| 636 | 636 | else: | |
| 637 | 637 | return osp.normpath(osp.join(repo_dir, "config")) | |
| 638 | 638 | else: | |
| 639 | - assert_never( # type:ignore[unreachable] | ||
| 639 | + assert_never( # type: ignore[unreachable] | ||
| 640 | 640 | config_level, | |
| 641 | 641 | ValueError(f"Invalid configuration level: {config_level!r}"), | |
| 642 | 642 | ) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -517,7 +517,7 @@ def expand_path(p: Union[None, PathLike], expand_vars: bool = True) -> Optional[ | |||
| 517 | 517 | if isinstance(p, pathlib.Path): | |
| 518 | 518 | return p.resolve() | |
| 519 | 519 | try: | |
| 520 | - p = osp.expanduser(p) # type: ignore | ||
| 520 | + p = osp.expanduser(p) # type: ignore[arg-type] | ||
| 521 | 521 | if expand_vars: | |
| 522 | 522 | p = osp.expandvars(p) | |
| 523 | 523 | return osp.normpath(osp.abspath(p)) | |
@@ -1209,7 +1209,7 @@ def __getattr__(self, attr: str) -> T_IterableObj: | |||
| 1209 | 1209 | # END for each item | |
| 1210 | 1210 | return list.__getattribute__(self, attr) | |
| 1211 | 1211 | ||
| 1212 | - def __getitem__(self, index: Union[SupportsIndex, int, slice, str]) -> T_IterableObj: # type: ignore | ||
| 1212 | + def __getitem__(self, index: Union[SupportsIndex, int, slice, str]) -> T_IterableObj: # type: ignore[override] | ||
| 1213 | 1213 | assert isinstance(index, (int, str, slice)), "Index of IterableList should be an int or str" | |
| 1214 | 1214 | ||
| 1215 | 1215 | if isinstance(index, int): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments