-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added pre-commit hook for clang-format (linter) and integrated GitHub…
… actions workflow for clang-tidy CI
- Loading branch information
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
BasedOnStyle: LLVM | ||
IndentWidth: 4 | ||
ColumnLimit: 80 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Clang-Tidy CI | ||
|
||
on: | ||
# Run the workflow on every pull request to the main branch | ||
pull_request: | ||
branches: | ||
- main | ||
# Optionally, run the workflow on each push to the repository | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
clang_tidy_check: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up build environment | ||
run: | | ||
sudo apt update | ||
sudo apt install -y clang-tidy cmake build-essential | ||
- name: Build project | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake .. | ||
make | ||
- name: Run Clang-Tidy | ||
run: | | ||
cd build | ||
clang-tidy ../src/**/*.cpp -- -I../include -std=c++20 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"files.associations": { | ||
"ostream": "cpp" | ||
} | ||
} |