diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7dc2c8592..657a00a2a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: sort-simple-yaml - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.4.10' + rev: 'v0.5.0' hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/dvc/daemon.py b/dvc/daemon.py index 5dd8eda54..90deebd81 100644 --- a/dvc/daemon.py +++ b/dvc/daemon.py @@ -44,10 +44,10 @@ def _win_detached_subprocess(args: Sequence[str], **kwargs) -> int: startupinfo = STARTUPINFO() startupinfo.dwFlags |= STARTF_USESHOWWINDOW - popen = subprocess.Popen( + popen = subprocess.Popen( # noqa: S603 args, close_fds=True, - shell=False, # noqa: S603 + shell=False, startupinfo=startupinfo, creationflags=creationflags, **kwargs, diff --git a/dvc/repo/checkout.py b/dvc/repo/checkout.py index e214fc853..176749a4a 100644 --- a/dvc/repo/checkout.py +++ b/dvc/repo/checkout.py @@ -125,7 +125,7 @@ def checkout( # noqa: C901 (StageFileDoesNotExistError, StageFileBadNameError, NoOutputOrStageError), ): raise CheckoutErrorSuggestGit(target) from exc - raise + raise # noqa: PLE0704 view = self.index.targets_view( targets, recursive=recursive, with_deps=with_deps, onerror=onerror diff --git a/dvc/repo/experiments/collect.py b/dvc/repo/experiments/collect.py index b88db05e1..42d0ab434 100644 --- a/dvc/repo/experiments/collect.py +++ b/dvc/repo/experiments/collect.py @@ -69,11 +69,11 @@ def collect_rev( def _collect_rev( repo: "Repo", - rev: str, + revision: str, param_deps: bool = False, **kwargs, ) -> SerializableExp: - with repo.switch(rev) as rev: + with repo.switch(revision) as rev: if rev == "workspace": timestamp: Optional[datetime] = None else: diff --git a/dvc/repo/index.py b/dvc/repo/index.py index ba1d63a93..ea872086d 100644 --- a/dvc/repo/index.py +++ b/dvc/repo/index.py @@ -600,7 +600,7 @@ class Index: if not onerror: def onerror(_target, _exc): - raise + raise # noqa: PLE0704 targets = ensure_list(targets) if not targets: diff --git a/dvc/stage/run.py b/dvc/stage/run.py index 703c397c8..d193b1b0e 100644 --- a/dvc/stage/run.py +++ b/dvc/stage/run.py @@ -27,8 +27,8 @@ def _fish_supports_no_config(executable) -> bool: bool: True if the fish version is greater than 3.3.0, False otherwise. """ try: - output = subprocess.check_output( - [executable, "--version"], # noqa: S603 + output = subprocess.check_output( # noqa: S603 + [executable, "--version"], text=True, ) version = Version(output.split(" ")[-1].strip()) diff --git a/dvc/testing/fixtures.py b/dvc/testing/fixtures.py index 189310e28..fe30dfc85 100644 --- a/dvc/testing/fixtures.py +++ b/dvc/testing/fixtures.py @@ -228,10 +228,10 @@ def docker_services(tmp_path_factory, request): pytest.skip("disabled for Windows on CI") try: - subprocess.check_output( + subprocess.check_output( # noqa: S602 "docker ps", # noqa: S607 stderr=subprocess.STDOUT, - shell=True, # noqa: S602 + shell=True, ) except subprocess.CalledProcessError as err: out = (err.output or b"").decode("utf-8")