-
Notifications
You must be signed in to change notification settings - Fork 58
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
C headers can mistakenly be recognized as C++ #78
Comments
I'm not sure :( |
Yeah that's exactly the pain point. Indeed some people prefer to use ".h" also for C++, as ISO C++ core guideline implies...
My idea is to add a command-line option to overwrite the list of the extensions for C. When the command-line option is not set, the behavior will be the same.
In my use case, C and C++ files can coexist in a project, but they have separate extensions. That is, ".c" and ".h" for C, and ".cpp" and ".hpp" for C++. |
This'd still break for larger projects, where the two conventions are mixed. What about a tag on each such target? Would that work for you? |
I guess the use of tags will also be fine for my use case. |
Hi.
While I'm using
bazel_clang_tidy
at a01e5e2, I noticed my C header with the extension ".h" is mistakenly recognized as C++.The cause of this issue is this line. When I changed its condition to
src.extension in ["c", "h"]
, the header was correctly recognized as C.I'd like to suggest changing that line so that the tool can correctly recognize C/C++, also taking other extensions (e.g. ".C") into account.
Any opinions?
The text was updated successfully, but these errors were encountered: