ZedThree / clang-tidy-review

Create a pull request review based on clang-tidy warnings
MIT License
90 stars 45 forks source link

Local header in codebase not found #79

Open vadi2 opened 1 year ago

vadi2 commented 1 year ago

I'm getting a FileNotFoundError: [Errno 2] No such file or directory: '/src/utils.h' error when src/utils.h is a valid header and it is listed in CMakeLists.txt.

What could be going wrong?

ZedThree commented 1 year ago

The real file path is ../../src/utils.h which is somehow getting expanded to /src/utils.h -- note the leading slash. So something has gone wrong in our file path fixing code I would guess, probably this line: https://github.com/ZedThree/clang-tidy-review/blob/4f11cae8aa5a0866738de40c1f6443b1a01d5642/post/clang_tidy_review/clang_tidy_review/__init__.py#L595

I have a couple of ideas how that might happen, but main guess is that it could be that it's a relative path from the build directory and we're not handling that correctly.