Skip to content

Commit e748d10

Browse files
committed
fix: code refactor
1 parent 7d82a56 commit e748d10

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ jobs:
2727
run: |
2828
python -m pip install --upgrade pip
2929
pip install .[dev]
30-
pip install setuptools # Ensure setuptools is available for pkg_resources
3130
3231
- name: Run tests and collect coverage
3332
run: |

cpp_linter_hooks/util.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ def get_version_from_dependency(tool: str) -> Optional[str]:
3535
return None
3636

3737

38-
DEFAULT_CLANG_FORMAT_VERSION = get_version_from_dependency("clang-format") or "20.1.7"
39-
DEFAULT_CLANG_TIDY_VERSION = get_version_from_dependency("clang-tidy") or "20.1.0"
38+
DEFAULT_CLANG_FORMAT_VERSION = get_version_from_dependency("clang-format")
39+
DEFAULT_CLANG_TIDY_VERSION = get_version_from_dependency("clang-tidy")
4040

4141

4242
CLANG_FORMAT_VERSIONS = [
@@ -186,7 +186,11 @@ def _resolve_install(tool: str, version: Optional[str]) -> Optional[Path]:
186186

187187
# Additional safety check in case DEFAULT versions are None
188188
if user_version is None:
189-
user_version = "20.1.7" if tool == "clang-format" else "20.1.0"
189+
user_version = (
190+
DEFAULT_CLANG_FORMAT_VERSION
191+
if tool == "clang-format"
192+
else DEFAULT_CLANG_TIDY_VERSION
193+
)
190194

191195
path = shutil.which(tool)
192196
if path:

0 commit comments

Comments
 (0)