Browse Source

ci: Add lint job to run clazy on our C++ code

Suppress all failing checks for now.  They can be incrementally
enabled and fixed in the future.
Brad King 5 tháng trước cách đây
mục cha
commit
bdb9d818d2

+ 7 - 0
.gitlab-ci.yml

@@ -140,6 +140,13 @@ l:clang-analyzer-fedora42:
     variables:
         CMAKE_CI_JOB_NIGHTLY: "true"
 
+l:clazy-fedora42:
+    extends:
+        - .fedora42_clazy
+        - .cmake_build_linux
+        - .linux_x86_64_tags
+        - .run_automatically
+
 # Linux builds
 
 b:centos7-x86_64:

+ 4 - 0
.gitlab/ci/configure_fedora42_clazy.cmake

@@ -0,0 +1,4 @@
+set(configure_no_sccache 1)
+set(CMake_QT_MAJOR_VERSION "5" CACHE STRING "")
+
+include("${CMAKE_CURRENT_LIST_DIR}/configure_fedora42_common.cmake")

+ 26 - 0
.gitlab/ci/env_fedora42_clazy.sh

@@ -0,0 +1,26 @@
+export CC=/usr/bin/clang
+export CXX=/usr/bin/clazy
+export CLANGXX=/usr/bin/clang++
+
+export CLAZY_CHECKS="level2\
+,no-base-class-event\
+,no-connect-3arg-lambda\
+,no-connect-by-name\
+,no-container-inside-loop\
+,no-copyable-polymorphic\
+,no-ctor-missing-parent-argument\
+,no-function-args-by-ref\
+,no-function-args-by-value\
+,no-missing-qobject-macro\
+,no-non-pod-global-static\
+,no-old-style-connect\
+,no-qproperty-without-notify\
+,no-qstring-allocations\
+,no-range-loop-detach\
+,no-range-loop-reference\
+,no-reserve-candidates\
+,no-rule-of-three\
+,no-rule-of-two-soft\
+,no-static-pmf\
+,no-strict-iterators\
+"

+ 9 - 0
.gitlab/os-linux.yml

@@ -115,6 +115,15 @@
         CTEST_NO_WARNINGS_ALLOWED: 1
         CMAKE_CI_NO_INSTALL: 1
 
+.fedora42_clazy:
+    extends: .fedora42
+
+    variables:
+        CMAKE_CONFIGURATION: fedora42_clazy
+        CMAKE_CI_BUILD_TYPE: Debug
+        CTEST_NO_WARNINGS_ALLOWED: 1
+        CMAKE_CI_NO_INSTALL: 1
+
 .fedora42_sphinx:
     extends: .fedora42