Skip to content

Commit d45ee3e

Browse files
committed
inject error
1 parent c2f2795 commit d45ee3e

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

.github/workflows/clang-tidy.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
-DCHECK_FOR_UPDATES=OFF \
3636
-DBUILD_EXAMPLES=ON \
3737
-DBUILD_TOOLS=ON \
38-
-DCMAKE_BUILD_TYPE=Release
38+
-DCMAKE_BUILD_TYPE=Debug
3939
4040
- name: Build project
4141
run: cmake --build build -j$(nproc)
@@ -160,10 +160,11 @@ jobs:
160160
# === NEW: Extract errors only to a separate log ===
161161
- name: Extract errors from clang-tidy log
162162
run: |
163-
# Extract actual clang-tidy errors, excluding:
163+
# Extract actual clang-tidy warnings/errors, excluding:
164164
# - clang-diagnostic-* (compilation errors)
165165
# - "Error while processing" messages
166-
grep -E 'error:' clang-tidy.log | \
166+
# Match format: /path/to/file.cpp:123:45: error: message [check-name]
167+
grep -E '^[^:]+:[0-9]+:[0-9]+: (error):' clang-tidy.log | \
167168
grep -v '\[clang-diagnostic' | \
168169
grep -v 'Error while processing' > clang-tidy-errors.log || true
169170

src/ds/d400/d400-auto-calibration.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,13 @@ namespace librealsense
271271
case ds_calib_common::SPEED_WHITE_WALL:
272272
_total_frames = 120;
273273
/* Inject string comparation issue by purpose to see if clang tidy finds it - REMOVE!!*/
274-
char * tmp = "NIR";
275-
if (tmp == "NIR")
276-
int a = 0;
274+
{
275+
const char * tmp = "NIR";
276+
if (tmp == "NIR") {
277+
int a = 0;
278+
a++; // Use the variable
279+
}
280+
}
277281
break;
278282
}
279283
std::fill_n(_fill_factor, 256, 0);

tools/dds/dds-adapter/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# License: Apache 2.0. See LICENSE file in root directory.
22
# Copyright(c) 2023-2024 RealSense, Inc. All Rights Reserved.
3-
cmake_minimum_required( VERSION 3.8 )
3+
cmake_minimum_required( VERSION 3.10 )
44
project( rs-dds-adapter )
55

66
set(TOOL_FILES

0 commit comments

Comments
 (0)