-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed #12017/#13723 - added command-line option --clang-tidy{=<exe>}
and fixed output
#7366
Conversation
Still needs a Python test and requires #7285 and #7291 to be merged. Prerequisite for fixing https://trac.cppcheck.net/ticket/12053. |
7b1e270
to
717b621
Compare
--clang-tidy{=<exe>}
--clang-tidy{=<exe>}
and fixed output
717b621
to
861a901
Compare
Need to make sure it is run within the CI (i.e. |
Confirmed.
|
// TODO: is this even necessary? | ||
// append .exe if it is not a path | ||
if (Path::fromNativeSeparators(mSettings.clangTidyExecutable).find('/') == std::string::npos) { | ||
exe += ".exe"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if exe
ends with ".exe" then don't append ".exe".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but.. I agree with the TODO comment. Use the clangTidyExecutable as-is. Use the exact path provided by the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will extend the tests when I fix the missing invocations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this code should just use clangTidyExecutable as-is. Remove the whole #ifdef ..
const std::string exe = mSettings.clangTidyExecutable;
If the user writes --clang-tidy=clang-tidy.exe
then you will add the ".exe" that feels bad.
If you really want to append the ".exe" then that should be done in the initialization in settings.h:
/** Custom clang-tidy executable */
#ifdef _WIN32
std::string clangTidyExecutable = "clang-tidy.exe";
#else
std::string clangTidyExecutable = "clang-tidy";
#endif
As you said maybe this is not necessary anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I said I will address this when the invocation are fixed in a follow-up since it is out-of-scope of the changes here.
The tests for this are also currently missing and I would have to add several overrides because invoking it is partially broken.
Anything still to do here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alright then.. if you do continue and look at the invocations asap after this then feel free to merge this now..
I just had another look and it is unfortunately not straight forward to fix. But on the upside it should automatically fix itself when |
No description provided.