Skip to content

Commit cba1813

Browse files
committed
fix: address review issues for unified CLI PR
- Fix uninstall_clang_tools argument order (version/tools were swapped) - Update CI workflow to use new subcommand syntax (clang-tools install, not --install) - Fix type annotations: tools: str → list[str] in install.py - Strengthen uninstall test to assert actual filesystem removal
1 parent 3072cea commit cba1813

4 files changed

Lines changed: 7 additions & 6 deletions

File tree

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
run: pip install --no-cache-dir dist/*.whl
9797

9898
- name: Install clang-tools binaries
99-
run: clang-tools --install ${{ matrix.version }} --tool clang-format clang-tidy clang-query clang-apply-replacements
99+
run: clang-tools install ${{ matrix.version }} --tool clang-format clang-tidy clang-query clang-apply-replacements
100100

101101
- name: Show path of clang-tools binaries
102102
shell: bash
@@ -145,7 +145,7 @@ jobs:
145145
shell: bash
146146
run: |
147147
set -e
148-
clang-tools-wheel --tool clang-format --version ${{ matrix.version }}
148+
clang-tools install clang-format --wheel --version ${{ matrix.version }}
149149
150150
echo "Checking clang-format versions..."
151151
clang-format --version
@@ -167,7 +167,7 @@ jobs:
167167
shell: bash
168168
run: |
169169
set -e
170-
clang-tools-wheel --tool clang-tidy --version ${{ matrix.version }}
170+
clang-tools install clang-tidy --wheel --version ${{ matrix.version }}
171171
172172
echo "Checking clang-tidy versions..."
173173
clang-tidy --version

clang_tools/install.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def uninstall_tool(tool_name: str, version: str, directory: str):
247247
symlink.unlink()
248248

249249

250-
def uninstall_clang_tools(tools: str, version: str, directory: str):
250+
def uninstall_clang_tools(tools: list[str], version: str, directory: str):
251251
"""Uninstall a clang tool of a given version.
252252
253253
:param version: The version of the clang-tools to remove.
@@ -261,7 +261,7 @@ def uninstall_clang_tools(tools: str, version: str, directory: str):
261261

262262

263263
def install_clang_tools(
264-
version: Version, tools: str, directory: str, overwrite: bool, no_progress_bar: bool
264+
version: Version, tools: list[str], directory: str, overwrite: bool, no_progress_bar: bool
265265
) -> None:
266266
"""Wraps functions used to individually install tools.
267267

clang_tools/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def main() -> int:
258258
return 0
259259

260260
if args.command == "uninstall":
261-
uninstall_clang_tools(args.version, args.tool, args.directory)
261+
uninstall_clang_tools(args.tool, args.version, args.directory)
262262
return 0
263263

264264
if args.command == "install":

tests/test_main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,3 +400,4 @@ def test_main_uninstall_subcommand(monkeypatch: pytest.MonkeyPatch, tmp_path, ca
400400
result = capsys.readouterr()
401401
assert exit_code == 0
402402
assert "Uninstalling" in result.out
403+
assert not dummy_bin.exists()

0 commit comments

Comments
 (0)