Skip to content
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

Ignoring Third Party Libraries with Regex #643

Closed
stungeye opened this issue Jul 25, 2019 · 4 comments
Closed

Ignoring Third Party Libraries with Regex #643

stungeye opened this issue Jul 25, 2019 · 4 comments
Assignees

Comments

@stungeye
Copy link

stungeye commented Jul 25, 2019

tl;dr I want to run Clang Tidy on files that I have written without being swamped by messages and errors from 3rd party libraries.

Context: I'm trying to use Clang Tidy via Clang Power Tools in Visual Studio 2019 with an openFrameworks project.

Problem: I am unable to ignore third party libraries, so Clang Tidy is stopping on "too many errors emitted".

Things I have tried:

All the third-party libraries are located in a path that includes a sub-directory named openFrameworksCompiled so I am trying to ignore them all using a regex match in the "File to ignore" extension settings: [regex]openFrameworksCompiled

settings

I've also tired ignoring using a rooted path as was suggested in issue #446.

The FAQ says to "include third party library dependencies via the Include directories project option." By default openFrameworks projects include 3rd party libraries via "Additional Include Directories", so I've tried manually switching all the 3rd party directories to "Include Directories" in the project settings. This did have the effect (seen by enabling verbose mode) of including the 3rd party libraries using -isystem instead of -I but the 3rd party files were still being process and so the "too many errors emitted" issue continued.

I have also tried to "treat additional includes as: system include directories" with no success

I've also got the Clang Power Tools Settings => Tidy => Header filter set to "Corresponding Header".

Is this an issue with the tool or am I going about this the wrong way?

@stungeye
Copy link
Author

stungeye commented Jul 25, 2019

For more context here's the output of Clang Tidy running in verbose mode:

verbose_output.txt

And again but with "treat additional includes as: system include directories":

verbose_output_additional_includes_as_system_includes.txt

And again with a "rooted path" ignore instead of a regex:

verbose_output_with_rooted_path.txt

@hero101111 hero101111 self-assigned this Jul 26, 2019
@hero101111
Copy link
Contributor

Hello @stungeye ,

Unfortunately, we cannot reproduce this issue.
To ignore third-party headers any of the following works:
1. In your Visual Studio project properties, move the third-party include directories to VC++ Directories > Include Directories instead of C/C++ > Additional Include Directories
2. From Clang Power Tools settings, set Treat additional include directories to System include directories

Can you provide a small sample project for investigation purposes?

Regards,
Gabriel.

@hero101111
Copy link
Contributor

Regarding the File to Ignore setting, this applies only to your source files, not third-party headers.
In your case there's no need to set it to openFrameworksCompiled.

@stungeye
Copy link
Author

stungeye commented Jul 26, 2019

Hello @hero101111 and thank you for your quick response. I have tried both of the options you suggest but neither has worked.

I've started running clang-tidy directly from the CLI and now see that the issues I'm running into are clang compile errors. I was able to get by some (in the Boost library) by changing clang's -std=c++14 to -std=c++11, but now I'm getting a bunch of clang-diagnostic-error errors in various Visual Studio MSVC header files.

The problem here is definitely not with Clang Power Tools so I am closing this issue.

In case you're interested, small sample project is available here: stungeye/Seeker-Boid-with-openFrameworks

You will also need a copy of openFrameworks: of_v0.10.1_vs2017_release.zip (It's the VS2017 release, but will work with VS2019 as long as you target x64 with latest Windows SDK version.)

Unzip this archive and then clone my sample repo into the openFrameworks apps sub-directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants