refactor(lint): fix clang-tidy lints
#228
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Lint | |
| on: [push, pull_request] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| format: | |
| name: "Formatting Check" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v2 | |
| - name: Clang-Format Formatting | |
| uses: jidicula/clang-format-action@v4.14.0 | |
| with: | |
| clang-format-version: '19' | |
| check-path: llvm-plugin/cpp | |
| - name: Rustfmt Formatting | |
| run: | | |
| cargo fmt --check --all | |
| lint: | |
| name: "Lint Check" | |
| runs-on: ubuntu-latest | |
| env: | |
| LLVM_INSTALL_PATH: ~/llvm | |
| LLVM_VERSION: "19" | |
| LLVM_VERSION_IN_FEATURE: "19-1" | |
| LLVM_LIB_NAME: "libLLVM.so.19.1" | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v2 | |
| - name: Setup LLVM Installation Path | |
| run: | | |
| mkdir ${{ env.LLVM_INSTALL_PATH }} | |
| echo "$HOME/llvm/bin" >> $GITHUB_PATH | |
| - name: Check LLVM Artifacts In Cache | |
| id: cache-llvm | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ${{ env.LLVM_INSTALL_PATH }}/bin/llvm-config | |
| ${{ env.LLVM_INSTALL_PATH }}/bin/opt | |
| ${{ env.LLVM_INSTALL_PATH }}/lib/${{ env.LLVM_LIB_NAME }} | |
| ${{ env.LLVM_INSTALL_PATH }}/lib/libLLVM.so | |
| ${{ env.LLVM_INSTALL_PATH }}/include | |
| key: ${{ runner.os }}-llvm-${{ env.LLVM_VERSION }}-opt | |
| - name: LLVM Artifacts Missing | |
| if: steps.cache-llvm.outputs.cache-hit != 'true' | |
| run: false | |
| - name: Clang-Tidy Lint | |
| run: | | |
| clang-tidy \ | |
| llvm-plugin/cpp/*.{cc,hh} \ | |
| --warnings-as-errors='*,-llvm-header-guard' \ | |
| -- -I"$HOME/llvm/include" -std=c++17 -DLLVM_VERSION_MAJOR=${{ env.LLVM_VERSION }} | |
| - name: Clippy Lint | |
| run: | | |
| cargo clippy \ | |
| -p llvm-plugin \ | |
| --no-default-features \ | |
| --features target-x86,llvm${{ env.LLVM_VERSION_IN_FEATURE }} \ | |
| -- -D warnings |