Skip to content

Commit

Permalink
Added pre-commit hook for clang-format (linter) and integrated GitHub…
Browse files Browse the repository at this point in the history
… actions workflow for clang-tidy CI
  • Loading branch information
ryanisho committed Apr 25, 2024
1 parent cbc7d92 commit f039554
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BasedOnStyle: LLVM
IndentWidth: 4
ColumnLimit: 80
36 changes: 36 additions & 0 deletions .github/workflows/clang-tidy.yaml
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
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.associations": {
"ostream": "cpp"
}
}

0 comments on commit f039554

Please sign in to comment.