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:
Claude
2026-02-11 07:45:58 +00:00
parent 6073f3f197
commit c541954a80
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -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__()
+1 -1
View File
@@ -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 "