Skip to content

Commit eac9503

Browse files
build: Remove clang-format and clang-tidy as dependencies (#194)
* Initial plan * fix: remove clang-format and clang-tidy as hard package dependencies Agent-Logs-Url: https://github.com/cpp-linter/cpp-linter-hooks/sessions/83cea442-8414-48d1-aa3f-8bb8e4b50a25 Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com> * ci: simplify release-drafter to read versions directly from versions.py Agent-Logs-Url: https://github.com/cpp-linter/cpp-linter-hooks/sessions/457283cf-0c70-4642-98a9-2a98c6a0c6bb Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com> * chore: Change CodSpeed mode from instrumentation to simulation --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com> Co-authored-by: Xianpeng Shen <xianpeng.shen@gmail.com>
1 parent 4a6686c commit eac9503

File tree

5 files changed

+6
-77
lines changed

5 files changed

+6
-77
lines changed

.github/workflows/codspeed.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ jobs:
4242
with:
4343
token: ${{ secrets.CODSPEED_TOKEN }}
4444
run: uv run pytest tests/ --codspeed
45-
mode: instrumentation
45+
mode: simulation

.github/workflows/release-drafter.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,12 @@ jobs:
1919
- name: Checkout repository
2020
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
2121

22-
- name: Set up Python
23-
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
24-
with:
25-
python-version: "3.12"
26-
27-
- name: Install dependencies
28-
run: |
29-
python -m pip install --upgrade pip
30-
python -m pip install -e .
31-
3222
- name: Extract default tool versions
3323
id: versions
3424
run: |
35-
# Get versions from Python
36-
CLANG_FORMAT_VERSION=$(python -c "from cpp_linter_hooks.util import DEFAULT_CLANG_FORMAT_VERSION; print(DEFAULT_CLANG_FORMAT_VERSION)")
37-
CLANG_TIDY_VERSION=$(python -c "from cpp_linter_hooks.util import DEFAULT_CLANG_TIDY_VERSION; print(DEFAULT_CLANG_TIDY_VERSION)")
25+
# Get versions directly from versions.py (no package install needed)
26+
CLANG_FORMAT_VERSION=$(python3 -c "import sys; sys.path.insert(0, 'cpp_linter_hooks'); from versions import CLANG_FORMAT_VERSIONS; print(CLANG_FORMAT_VERSIONS[-1])")
27+
CLANG_TIDY_VERSION=$(python3 -c "import sys; sys.path.insert(0, 'cpp_linter_hooks'); from versions import CLANG_TIDY_VERSIONS; print(CLANG_TIDY_VERSIONS[-1])")
3828
3929
# Export to GitHub Actions environment for subsequent steps
4030
echo "CLANG_FORMAT_VERSION=$CLANG_FORMAT_VERSION" >> $GITHUB_ENV

cpp_linter_hooks/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ def get_version_from_dependency(tool: str) -> Optional[str]:
3030
return None
3131

3232

33-
DEFAULT_CLANG_FORMAT_VERSION = get_version_from_dependency("clang-format")
34-
DEFAULT_CLANG_TIDY_VERSION = get_version_from_dependency("clang-tidy")
33+
DEFAULT_CLANG_FORMAT_VERSION = CLANG_FORMAT_VERSIONS[-1] # latest from versions.py
34+
DEFAULT_CLANG_TIDY_VERSION = CLANG_TIDY_VERSIONS[-1] # latest from versions.py
3535

3636

3737
def _resolve_version(versions: List[str], user_input: Optional[str]) -> Optional[str]:

pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ classifiers = [
3333
dependencies = [
3434
"pip>=20.3", # Required to install clang-format and clang-tidy
3535
"tomli>=1.1.0; python_version < '3.11'",
36-
"clang-format==22.1.1",
37-
"clang-tidy==22.1.0",
3836
]
3937
dynamic = ["version"]
4038

uv.lock

Lines changed: 0 additions & 59 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)