Skip to content

Commit d8f42ac

Browse files
committed
ruff: Format with ruff v0.14.5
uv run ruff check --select ALL . --fix --unsafe-fixes --preview --show-fixes; uv run ruff format . Fixed 10 errors: - src/vcspull/cli/add.py: 1 × PLR5501 (collapsible-else-if) - tests/cli/test_add.py: 2 × COM812 (missing-trailing-comma) 1 × F811 (redefined-while-unused) 1 × TC004 (runtime-import-in-type-checking-block) - tests/cli/test_discover.py: 1 × F811 (redefined-while-unused) 1 × TC004 (runtime-import-in-type-checking-block) - tests/test_config_writer.py: 1 × TC003 (typing-only-standard-library-import) - tests/test_utils.py: 1 × I001 (unsorted-imports) 1 × TC003 (typing-only-standard-library-import) Found 1125 errors (10 fixed, 1115 remaining). 2 files reformatted, 46 files left unchanged
1 parent 055e31a commit d8f42ac

File tree

5 files changed

+11
-13
lines changed

5 files changed

+11
-13
lines changed

src/vcspull/cli/add.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -463,12 +463,11 @@ def _ensure_workspace_label_for_merge(
463463
relabelled = True
464464
else:
465465
config_data.setdefault("./", {})
466+
elif existing_label is None:
467+
workspace_label = preferred_label
468+
config_data.setdefault(workspace_label, {})
466469
else:
467-
if existing_label is None:
468-
workspace_label = preferred_label
469-
config_data.setdefault(workspace_label, {})
470-
else:
471-
workspace_label = existing_label
470+
workspace_label = existing_label
472471

473472
if workspace_label not in config_data:
474473
config_data[workspace_label] = {}

tests/cli/test_add.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
from vcspull.cli.add import add_repo, create_add_subparser, handle_add_command
1919

2020
if t.TYPE_CHECKING:
21-
import pathlib
22-
2321
from _pytest.monkeypatch import MonkeyPatch
2422
from syrupy.assertion import SnapshotAssertion
2523

@@ -753,7 +751,7 @@ def test_handle_add_command_path_mode(
753751
{
754752
"test_id": test_id,
755753
"log": normalized_log.replace("<config>", "~/.vcspull.yaml"),
756-
}
754+
},
757755
)
758756
else:
759757
snapshot.assert_match({"test_id": test_id, "log": normalized_log})
@@ -911,7 +909,7 @@ class NoMergePreservationFixture(t.NamedTuple):
911909
repo: git+https://github.com/Stiivi/bubbles.git
912910
cubes:
913911
repo: git+https://github.com/Stiivi/cubes.git
914-
"""
912+
""",
915913
),
916914
expected_original_repos=(
917915
"Flexget",

tests/cli/test_discover.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
from vcspull.cli.discover import ConfigScope, _classify_config_scope, discover_repos
1515

1616
if t.TYPE_CHECKING:
17-
import pathlib
18-
1917
from _pytest.monkeypatch import MonkeyPatch
2018
from syrupy.assertion import SnapshotAssertion
2119

tests/test_config_writer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
from __future__ import annotations
44

5-
import pathlib
65
import textwrap
76
import typing as t
87

98
import pytest
109

1110
from vcspull.config import save_config_yaml_with_items
1211

12+
if t.TYPE_CHECKING:
13+
import pathlib
14+
1315
FixtureEntry = tuple[str, dict[str, t.Any]]
1416

1517

tests/test_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
from __future__ import annotations
44

5-
import pathlib
65
import typing as t
76

87
from vcspull.util import get_config_dir
98

109
if t.TYPE_CHECKING:
10+
import pathlib
11+
1112
import pytest
1213

1314

0 commit comments

Comments
 (0)