Skip to content

Commit 0542a12

Browse files
committed
git restore --source=origin/master tests src
1 parent 68c478d commit 0542a12

File tree

2 files changed

+12
-26
lines changed

2 files changed

+12
-26
lines changed

src/vcspull/cli/__init__.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -97,29 +97,27 @@ def create_parser(
9797

9898
add_parser = subparsers.add_parser(
9999
"add",
100-
help="add a new repository to the configuration",
100+
help="add a repository to the configuration",
101101
formatter_class=argparse.RawDescriptionHelpFormatter,
102-
description="Adds a new repository to the vcspull configuration file.",
102+
description="Add a repository to the vcspull configuration file.",
103103
)
104104
create_add_subparser(add_parser)
105105

106106
add_from_fs_parser = subparsers.add_parser(
107107
"add-from-fs",
108-
help="scan a directory for git repositories and add them to the configuration",
108+
help="scan filesystem for git repositories and add them to the configuration",
109109
formatter_class=argparse.RawDescriptionHelpFormatter,
110-
description="Scans a directory for git repositories and adds them to the vcspull configuration file.",
110+
description="Scan a directory for git repositories and add them to the vcspull configuration file.",
111111
)
112112
create_add_from_fs_subparser(add_from_fs_parser)
113113

114-
all_subparsers_dict = {
115-
"sync": sync_parser,
116-
"add": add_parser,
117-
"add_from_fs": add_from_fs_parser,
118-
}
119-
120-
if get_all_subparsers:
121-
return parser, subparsers, all_subparsers_dict
122-
114+
if get_all_subparsers and return_subparsers:
115+
all_parsers = {
116+
"sync": sync_parser,
117+
"add": add_parser,
118+
"add_from_fs": add_from_fs_parser,
119+
}
120+
return parser, subparsers, all_parsers
123121
if return_subparsers:
124122
return parser, sync_parser
125123
return parser
@@ -169,7 +167,7 @@ def cli(_args: list[str] | None = None) -> None:
169167
else None,
170168
}
171169
add_repo(**add_repo_kwargs)
172-
elif args.subparser_name == "add_from_fs":
170+
elif args.subparser_name == "add-from-fs":
173171
all_parsers["add_from_fs"]
174172
add_from_fs_kwargs = {
175173
"scan_dir_str": args.scan_dir,

tests/helpers.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import os
66
import typing as t
77

8-
import yaml
98
from typing_extensions import Self
109

1110
from vcspull._internal.config_reader import ConfigReader
@@ -62,14 +61,3 @@ def write_config(config_path: pathlib.Path, content: str) -> pathlib.Path:
6261
def load_raw(data: str, fmt: t.Literal["yaml", "json"]) -> dict[str, t.Any]:
6362
"""Load configuration data via string value. Accepts yaml or json."""
6463
return ConfigReader._load(fmt=fmt, content=data)
65-
66-
67-
def save_config_yaml(config_file_path: pathlib.Path, data: dict[t.Any, t.Any]) -> None:
68-
"""Save a dictionary to a YAML file by utilizing write_config.
69-
70-
The primary difference from `write_config` is that this function
71-
accepts a dictionary and handles YAML serialization before calling
72-
`write_config`.
73-
"""
74-
yaml_content: str = yaml.dump(data)
75-
write_config(config_file_path, yaml_content)

0 commit comments

Comments
 (0)