aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy12
-rw-r--r--.gitlab-ci.yml19
2 files changed, 30 insertions, 1 deletions
diff --git a/.clang-tidy b/.clang-tidy
new file mode 100644
index 0000000..d56b1e9
--- /dev/null
+++ b/.clang-tidy
@@ -0,0 +1,12 @@
+Checks: >
+ bugprone-*,
+ clang-analyzer-*,
+ performance-*,
+ modernize-*,
+ readability-*,
+ -modernize-use-trailing-return-type,
+ -readability-identifier-length,
+ -readability-magic-numbers
+WarningsAsErrors: ''
+HeaderFilterRegex: 'src/.*'
+FormatStyle: file
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 40e9ae4..661ff2c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,6 +1,7 @@
stages:
- build
- test
+ - lint
variables:
BUILD_TYPE: Release
@@ -37,4 +38,20 @@ test:
script:
- apt-get update && apt-get install -y jq
- - ./perft.bash \ No newline at end of file
+ - ./perft.bash
+clang-tidy:
+ stage: lint
+ image: ubuntu:24.04
+
+ rules:
+ - if: $CI_COMMIT_BRANCH == "main"
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
+
+ before_script:
+ - apt-get update
+ - apt-get install -y cmake gcc-14 g++-14 clang-tidy
+ script:
+ - export CC=gcc-14
+ - export CXX=g++-14
+ - cmake -B build -S . -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
+ - run-clang-tidy -p build src \ No newline at end of file