Skip to content

Instantly share code, notes, and snippets.

@dyigitpolat
Created February 16, 2023 11:46
Show Gist options
  • Save dyigitpolat/673483949ec9270ca6900652c2f568b9 to your computer and use it in GitHub Desktop.
Save dyigitpolat/673483949ec9270ca6900652c2f568b9 to your computer and use it in GitHub Desktop.
c++20 script to run clang tidy in include and src
#!/bin/bash
# run clang tidy for all files in include and src
# get the list of files
files=$(find include src -name "*.hpp" -o -name "*.cpp")
# useful checks for c++20
checks="-*,readability*,clang-analyzer*,cppcoreguidelines*,bugprone*,modernize*"
# run clang tidy
for file in $files ; do
echo "Running clang-tidy on $file"
echo ""
clang-tidy-15 -header-filter=.* -checks=$checks $file -- -Iinclude -std=c++20
echo ""
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment