You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using CodeChecker to run clang-tidy, if the UseColor option is true and there are errors present, the setup to produce a debug zip fails due to the colours/bold in stdout. Output below (removed list of checks to reduce clutter):
[INFO 2025-01-05 17:30] - Enabled checkers:
clang-tidy: bugprone-assert-side-effect ....
[INFO 2025-01-05 17:30] - Starting static analysis ...
[ERROR 2025-01-05 17:30] - Analyzing main.cpp with clang-tidy failed!
[ERROR 2025-01-05 17:30] -
/home/user/west-workspace/notus/tests/button/src/main.cpp:64:9: error: variable name 'i' is too short, expected at least 3 characters [readability-identifier-length,-warnings-as-errors]
64 | int i = 0;
| ^
/home/user/west-workspace/notus/tests/button/src/main.cpp:65:5: error: do not call c-style vararg functions [cppcoreguidelines-pro-type-vararg,hicpp-vararg,-warnings-as-errors]
65 | printf("i%d", i);
| ^
[ERROR 2025-01-05 17:30] -
104532 warnings generated.
Suppressed 104572 warnings (104529 in non-user code, 43 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
2 warnings treated as errors
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/tu_collector/tu_collector.py", line 372, in add_sources_to_zip
archive.getinfo(archive_path)
File "/usr/lib/python3.10/zipfile.py", line 1443, in getinfo
raise KeyError(
KeyError: "There is no item named 'sources-root/home/user/west-workspace/notus/tests/button/build/\\x1b[1m/home/user/west-workspace/notus/tests/button/src/main.cpp' in the archive"
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/codechecker_analyzer/analysis_manager.py", line 638, in check
handle_analysis_result(success=False)
File "/usr/local/lib/python3.10/dist-packages/codechecker_analyzer/analysis_manager.py", line 614, in handle_analysis_result
handle_failure(source_analyzer, rh,
File "/usr/local/lib/python3.10/dist-packages/codechecker_analyzer/analysis_manager.py", line 331, in handle_failure
handle_reproducer(source_analyzer, rh, zip_file, actions_map)
File "/usr/local/lib/python3.10/dist-packages/codechecker_analyzer/analysis_manager.py", line 291, in handle_reproducer
tu_collector.add_sources_to_zip(
File "/usr/local/lib/python3.10/dist-packages/tu_collector/tu_collector.py", line 374, in add_sources_to_zip
archive.write(f, archive_path, zipfile.ZIP_DEFLATED)
File "/usr/lib/python3.10/zipfile.py", line 1741, in write
zinfo = ZipInfo.from_file(filename, arcname,
File "/usr/lib/python3.10/zipfile.py", line 504, in from_file
st = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: '/home/user/west-workspace/notus/tests/button/build/\x1b[1m/home/user/west-workspace/notus/tests/button/src/main.cpp'
[INFO 2025-01-05 17:30] - [1/3] clang-tidy analyzed button.cpp successfully.
[INFO 2025-01-05 17:30] - [2/3] clang-tidy analyzed button_error.cpp successfully.
[INFO 2025-01-05 17:30] - ----==== Summary ====----
[INFO 2025-01-05 17:30] - Successfully analyzed
[INFO 2025-01-05 17:30] - clang-tidy: 2
[INFO 2025-01-05 17:30] - Failed to analyze
[INFO 2025-01-05 17:30] - clang-tidy: 1
[INFO 2025-01-05 17:30] - Reanalyzed compilation commands: 3
[INFO 2025-01-05 17:30] - Total analyzed compilation commands: 3
[INFO 2025-01-05 17:30] - Skipped compilation commands: 80
[INFO 2025-01-05 17:30] - ----=================----
[INFO 2025-01-05 17:30] - Analysis finished.
[INFO 2025-01-05 17:30] - To view results in the terminal use the "CodeChecker parse" command.
[INFO 2025-01-05 17:30] - To store results use the "CodeChecker store" command.
[INFO 2025-01-05 17:30] - See --help and the user guide for further options about parsing and storing the reports.
[INFO 2025-01-05 17:30] - ----=================----
[INFO 2025-01-05 17:30] - Analysis length: 9.457396984100342 sec.
CodeChecker version
6.23.1
To Reproduce
Run CodeChecker analyze --analyzers=clang-tidy --analyzer-config=clang-tidy:take-config-from-directory=true
Where the .clang-tidy contains UseColor: true.
This causes the clang-tidy output to be in bold, captured by the handle_reproducer in analysis_manager.py.
Expected behaviour
It not to fail to zip the files while UseColor is enabled
Desktop (please complete the following information)
OS: Linux (WSL2)
The text was updated successfully, but these errors were encountered:
Describe the bug
When using CodeChecker to run clang-tidy, if the
UseColor
option is true and there are errors present, the setup to produce a debug zip fails due to the colours/bold in stdout. Output below (removed list of checks to reduce clutter):CodeChecker version
6.23.1
To Reproduce
Run
CodeChecker analyze --analyzers=clang-tidy --analyzer-config=clang-tidy:take-config-from-directory=true
Where the
.clang-tidy
containsUseColor: true
.This causes the clang-tidy output to be in bold, captured by the
handle_reproducer
inanalysis_manager.py
.Expected behaviour
It not to fail to zip the files while
UseColor
is enabledDesktop (please complete the following information)
The text was updated successfully, but these errors were encountered: