Skip to content

Commit a0145ba

Browse files
committed
Remove unused arguments to dotm()
1 parent 7523326 commit a0145ba

2 files changed

Lines changed: 5 additions & 13 deletions

File tree

dotm/main.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ def get_relevant_files(config: dict) -> list[Dotfile]:
2323
return relevant
2424

2525

26-
def dotm(
27-
config: dict, source_dir: Path, target_dir: Path
28-
) -> tuple[list[Dotfile], list[Dotfile]]:
26+
def dotm(config: dict) -> tuple[list[Dotfile], list[Dotfile]]:
2927
"""Link relevant dotfiles according to .dotrc configuration."""
3028

3129
try:
@@ -62,14 +60,8 @@ def dotm(
6260

6361

6462
def main():
65-
working_dir = Path.cwd()
66-
home_dir = Path.home()
67-
68-
dotm(
69-
config=load_config(working_dir, home_dir),
70-
source_dir=working_dir,
71-
target_dir=home_dir,
72-
)
63+
cfg = load_config(source_dir=Path.home(), target_dir=Path.cwd())
64+
dotm(cfg)
7365

7466

7567
if __name__ == "__main__":

dotm/main_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def test_no_relevant_files(source_dir, target_dir, capsys, mocker):
2525
mocker.patch("dotm.main.gethostname", return_value="host")
2626

2727
with pytest.raises(SystemExit) as excinfo:
28-
dotm({}, source_dir, target_dir)
28+
dotm({})
2929

3030
stderr = capsys.readouterr().out
3131
assert 'No files matching host "host"' in stderr
@@ -60,7 +60,7 @@ def test_dotm(mocker, source_dir, target_dir):
6060
touch_dotrc(source_dir, cfg)
6161

6262
mocker.patch("dotm.main.gethostname", return_value="host1")
63-
existing, created = dotm(cfg, source_dir, target_dir)
63+
existing, created = dotm(cfg)
6464

6565
assert [df.name for df in created] == [".emacs", ".bashrc"]
6666
assert existing == []

0 commit comments

Comments
 (0)