etl/test/run-clang-tidy.sh
Roland Reichwein 652034603b
Add test/run-clang-tidy.sh (#1409)
* Print test names at test time (#1343)

* Fix operator| conflict with std::ranges (#1395)

* Add test/run-clang-tidy.sh

Also, add .clang-tidy configuration file.

In test/syntax_check/CMakeLists.txt, make ETL headers non-system headers.

Added .github/workflow/clang-tidy.yaml. Does not break the build for now
on clang-tidy findings/warnings.

Fix syntax issues

Those issues were uncovered by making ETL headers
non-system headers in test/syntax_checks/CMakeLists.txt

* Fix macro syntax

---------

Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
2026-05-18 08:01:17 +01:00

30 lines
755 B
Bash
Executable File

#!/bin/bash
#
# Execute from project root directory
#
set -euo pipefail
if [[ ! -f CMakeLists.txt || ! -d .git ]]; then
echo "Error: must be run from the project root directory" >&2
exit 1
fi
export CMAKE_EXPORT_COMPILE_COMMANDS=ON
CMAKE_BUILD_PARALLEL_LEVEL=$(nproc)
export CMAKE_BUILD_PARALLEL_LEVEL
cd test/syntax_check
rm -rf build-clang-tidy
mkdir -p build-clang-tidy
cd build-clang-tidy
CC=clang CXX=clang++ cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF \
-DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_CXX_STANDARD=17 ..
cmake --build .
cd ../../..
run-clang-tidy -j "$(nproc)" -p test/syntax_check/build-clang-tidy
# TODO: Add -warnings-as-errors='*' once the code is clean of warnings.