From 8208846003e8d29a44bf081b16ef2b821fd27c42 Mon Sep 17 00:00:00 2001 From: skshetry <18718008+skshetry@users.noreply.github.com> Date: Tue, 31 Jan 2023 11:24:03 +0545 Subject: [PATCH] bump ruff to 0.0.238 (#8915) --- .pre-commit-config.yaml | 2 +- dvc/dependency/repo.py | 2 +- dvc/fs/dvc.py | 2 +- dvc/logger.py | 2 +- dvc/repo/experiments/__init__.py | 2 +- dvc/repo/metrics/show.py | 2 +- dvc/repo/params/show.py | 2 +- pyproject.toml | 10 +++++----- tests/unit/proc/test_process.py | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c45bc580d..f690e4521 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,7 +43,7 @@ repos: hooks: - id: isort - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: 'v0.0.236' + rev: 'v0.0.238' hooks: - id: ruff - repo: https://github.com/codespell-project/codespell diff --git a/dvc/dependency/repo.py b/dvc/dependency/repo.py index 7238b1bd4..b9ab815b2 100644 --- a/dvc/dependency/repo.py +++ b/dvc/dependency/repo.py @@ -139,7 +139,7 @@ class RepoDependency(Dependency): self._check_circular_import(odb, obj_ids) used_obj_ids[odb].update(obj_ids) except (NoRemoteError, NoOutputOrStageError): - pass + pass # noqa: S110 try: object_store, meta, obj = build( diff --git a/dvc/fs/dvc.py b/dvc/fs/dvc.py index b5df81054..6928a425a 100644 --- a/dvc/fs/dvc.py +++ b/dvc/fs/dvc.py @@ -304,7 +304,7 @@ class _DVCFileSystem(AbstractFileSystem): # pylint:disable=abstract-method ): fs_infos[fs.path.name(info["name"])] = info except (FileNotFoundError, NotADirectoryError): - pass + pass # noqa: S110 dvcfiles = kwargs.get("dvcfiles", False) diff --git a/dvc/logger.py b/dvc/logger.py index 5a1366121..ecf525a68 100644 --- a/dvc/logger.py +++ b/dvc/logger.py @@ -156,7 +156,7 @@ class LoggerHandler(logging.StreamHandler): if not _is_verbose(): return except Exception: # noqa, pylint: disable=broad-except - pass + pass # noqa: S110 msg = self.format(record) Tqdm.write( diff --git a/dvc/repo/experiments/__init__.py b/dvc/repo/experiments/__init__.py index d87534bed..eb8fb198a 100644 --- a/dvc/repo/experiments/__init__.py +++ b/dvc/repo/experiments/__init__.py @@ -426,7 +426,7 @@ class Experiments: try: name = ExpRefInfo.from_ref(ref).name except InvalidExpRefError: - pass + pass # noqa: S110 if not name: if rev in self.stash_revs: name = self.stash_revs[rev].name diff --git a/dvc/repo/metrics/show.py b/dvc/repo/metrics/show.py index 638ff89d5..0ce1c3420 100644 --- a/dvc/repo/metrics/show.py +++ b/dvc/repo/metrics/show.py @@ -148,7 +148,7 @@ def show( except (SCMError, NoSCMError): # SCMError - detached head # NoSCMError - no repo case - pass + pass # noqa: S110 else: if res.get("workspace") == res.get(active_branch): res.pop("workspace", None) diff --git a/dvc/repo/params/show.py b/dvc/repo/params/show.py index 276e34601..317d4c230 100644 --- a/dvc/repo/params/show.py +++ b/dvc/repo/params/show.py @@ -171,7 +171,7 @@ def show( except (SCMError, NoSCMError): # SCMError - detached head # NoSCMError - no repo case - pass + pass # noqa: S110 else: if res.get("workspace") == res.get(active_branch): res.pop("workspace", None) diff --git a/pyproject.toml b/pyproject.toml index 3a4a7cfef..835ac1360 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -161,15 +161,11 @@ line_length = 79 line-length = 79 target-version = "py38" show-source = true -ignore = ["S101", "PT004", "PT007", "PT019", "SIM105", "SIM108", "SIM110", "SIM111", "SIM117", "TRY003", "TRY200", "TRY300", "TRY301", "PLR2004", "RUF005"] +ignore = ["S101", "PT004", "PT007", "PT019", "SIM105", "SIM108", "SIM110", "SIM111", "SIM117", "TRY003", "TRY200", "TRY300", "TRY301", "PLR0913", "PLR2004", "RUF005"] select = ["F", "E", "W", "C90", "UP", "YTT", "S", "BLE", "B", "A", "C4", "T10", "ISC", "ICN", "G", "INP", "PIE", "T20", "PT", "Q", "RET501", "RET504", "SIM", "TID", "TCH", "ARG", "PGH", "PLC", "PLE", "PLR", "PLW", "TRY", "RUF"] # external flake8 codes that should be preserved external = ["B301", "B024", "C901", "E302", "F401", "W601"] -[tool.ruff.per-file-ignores] -"dvc/testing/*.py" = ["ARG002"] -"scripts/**/*.py" = ["T201", "INP001", "TRY002"] - [tool.ruff.flake8-pytest-style] fixture-parentheses = false mark-parentheses = false @@ -187,6 +183,10 @@ strict = true [tool.ruff.flake8-unused-arguments] ignore-variadic-names = true +[tool.ruff.per-file-ignores] +"dvc/testing/*.py" = ["ARG002"] +"scripts/**/*.py" = ["T201", "INP001", "TRY002"] + [tool.pytest.ini_options] log_level = "debug" addopts = "-ra --cov-config pyproject.toml" diff --git a/tests/unit/proc/test_process.py b/tests/unit/proc/test_process.py index 9fe71904e..53cd05fe1 100644 --- a/tests/unit/proc/test_process.py +++ b/tests/unit/proc/test_process.py @@ -31,11 +31,11 @@ def test_init_args(tmp_dir, args, mocker): def test_run(tmp_dir, mocker): proc = ManagedProcess("/bin/foo") - assert TEST_PID == proc.pid + assert proc.pid == TEST_PID with open(proc.info_path, encoding="utf-8") as fobj: info = ProcessInfo.from_dict(json.load(fobj)) - assert TEST_PID == info.pid + assert info.pid == TEST_PID def test_wait(tmp_dir, mocker):