Skip to content

Commit ca432dd

Browse files
committed
feat: add pre-commit hooks and fix build issues
1. add pre-commit hooks 2. try to fix build clang-tidy issue
1 parent e08a93f commit ca432dd

File tree

5 files changed

+26
-5
lines changed

5 files changed

+26
-5
lines changed

.github/workflows/build-amd64.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,13 @@ jobs:
134134
- name: patch cmake implicit link libraries on macosx
135135
if: ${{ matrix.os == 'macosx' }}
136136
shell: bash
137-
run: |
137+
run: |
138138
sed -i.backup 's/gcc_eh.\*|/gcc_eh.*|gcc_ext.*|/g' "$(find /opt/homebrew/Cellar -name CMakeParseImplicitLinkInfo.cmake)"
139139
brew install gcc@11
140+
- name: update homebrew
141+
if: ${{ matrix.os == 'macosx' }} && matrix.clang-version >= '18'
142+
shell: bash
143+
run: brew upgrade node
140144
- name: cmake
141145
run: cmake -S ${{ matrix.release }}/llvm -B ${{ matrix.release }}/build ${{ env.COMMON_CMAKE_ARGS }} ${{ matrix.os-cmake-args }} ${{ matrix.extra-cmake-args }}
142146
- name: build

.github/workflows/pre-commit.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Run pre-commit
2+
3+
on:
4+
push:
5+
pull_request:
6+
types: opened
7+
8+
jobs:
9+
pre-commit:
10+
uses: cpp-linter/.github/.github/workflows/pre-commit.yml@main

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
default: ''
99
required: true
1010
type: string
11-
11+
1212
jobs:
1313
install:
1414
runs-on: ${{ matrix.os }}
@@ -59,7 +59,7 @@ jobs:
5959
chmod +x clang-query-${{ env.bin_suffix }}
6060
echo "== Output clang-query version"
6161
./clang-query-${{ env.bin_suffix }} --version
62-
62+
6363
gh release download ${{ inputs.tag }} --pattern 'clang-apply-replacements-${{ env.bin_suffix }}'
6464
gh release download ${{ inputs.tag }} --pattern 'clang-apply-replacements-${{ env.checksum_suffix }}'
6565
echo "== Output clang-apply-replacements checksum"

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: trailing-whitespace
6+
exclude: '\.patch$'
7+
- id: check-yaml

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
[![Test](https://github.com/cpp-linter/clang-tools-static-binaries/actions/workflows/test.yml/badge.svg)](https://github.com/cpp-linter/clang-tools-static-binaries/actions/workflows/test.yml)
55
![](https://img.shields.io/badge/platform-linux--64%20%7C%20win--64%20%7C%20osx--64%20-blue)
66

7-
Includes clang-format, clang-tidy, clang-query and clang-apply-replacements.
7+
Includes clang-format, clang-tidy, clang-query and clang-apply-replacements.
88

99
The supported versions are as follows:
1010

1111
|OS/Version |19|18 |17 |16 |15 |14 |13 |12 |11 |10 |9 |8 |7 |
1212
|-----------|--|---|---|---|---|---|---|---|---|---|---|---|---|
13-
|Linux 64 |✔️|✔️ |✔️|✔️|✔️ |✔️|✔️ |✔️ |✔️|✔️| ✔️|✔️|✔️ |
13+
|Linux 64 |✔️|✔️ |✔️|✔️|✔️ |✔️|✔️ |✔️ |✔️|✔️| ✔️|✔️|✔️ |
1414
|Window 64 |✔️|✔️ |✔️|✔️|✔️ |✔️|✔️ |✔️ |✔️|✔️| ✔️|✔️|✔️ |
1515
|macOS 64 |✔️|✔️ |✔️|✔️|✔️ |✔️|✔️ |✔️ |✔️|✔️| ✔️|✔️|✔️ |
1616

0 commit comments

Comments
 (0)