mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-01 23:08:43 +01:00
fix: resolve ruff v0.15.0 linter errors
- PYI034: Use `Self` return type for `__enter__` in SCMContext - PLW0108: Replace unnecessary lambda with direct `bool` reference https://claude.ai/code/session_01M18n2k6KLenwMRANgSFMXc
This commit is contained in:
@@ -10,6 +10,8 @@ from dvc.utils import relpath
|
||||
from dvc.utils.collections import ensure_list
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing_extensions import Self
|
||||
|
||||
from dvc.repo import Repo
|
||||
from dvc.scm import Base
|
||||
|
||||
@@ -131,7 +133,7 @@ class SCMContext:
|
||||
|
||||
self.files_to_track = set()
|
||||
|
||||
def __enter__(self) -> "SCMContext":
|
||||
def __enter__(self) -> "Self":
|
||||
self._cm = self()
|
||||
return self._cm.__enter__()
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ def test_help(caplog, capsys, command_tuples):
|
||||
out, err = capsys.readouterr()
|
||||
|
||||
# validate metavars are all in lowercase
|
||||
usage = "\n".join(takewhile(lambda o: bool(o), out.splitlines()))
|
||||
usage = "\n".join(takewhile(bool, out.splitlines()))
|
||||
|
||||
message = (
|
||||
"metavars not lowercased, you are likely missing formatter_class=XXX "
|
||||
|
||||
Reference in New Issue
Block a user