Error when using clang_format analyzer with subfolders
d-cheholia opened this issue · 0 comments
d-cheholia commented
Description
When using universum.analysers.clang_format
with source files in subfolders, an error [Errno 2] No such file or directory error
occurs
Steps to reproduce
- Create .cpp source file in subfolder (for example
<root>/src/main.cpp
)- Put some code in the file:
#include <iostream> int main() { std::cout << "Hello, World!" << std::endl; return 0; }
- Put some code in the file:
- Configure .universum file in root folder:
#!/usr/bin/env python3
from universum.configuration_support import Configuration, Step
configs = Configuration(
[
Step(
name="clang-format",
code_report=True,
command=[
"python3",
"-m",
"universum.analyzers.clang_format",
"--executable",
"clang-format",
"--files",
"**/*.cpp",
"--result-file",
"${CODE_REPORT_FILE}"
],
),
]
)
if __name__ == "__main__":
print(configs.dump())
- Run
universum
with the following command:
python3 -m universum run
Expected result
Created <root>/code_report_results/clang-format.json
file with formatting problems found.
Actual result
Got an error stderr: [Errno 2] No such file or directory: '/home/dev/projects/code-examples/clang-format/src/main.cpp'
Environment
- OS: Ubuntu 23.10
- Python version 3.11
- Universum version 0.19.19