Skip to content

Support include_what_you_use running on CI #624

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

Closed
mithro opened this issue May 30, 2019 · 7 comments · Fixed by #3048
Closed

Support include_what_you_use running on CI #624

mithro opened this issue May 30, 2019 · 7 comments · Fixed by #3048
Assignees
Labels
no-stale Exclude issue from being automatically marked as stale

Comments

@mithro
Copy link
Contributor

mithro commented May 30, 2019

Proposed Behaviour

include-what-you-use is a tool which makes sure that your C and C++ files include the correct set of headers. This makes it easier to refactor code as it doesn't stop working randomly because a include is missing.

Current Behaviour

You can accidentally forget to add an include but the code still works because something else includes it.

Context

This is another code quality improvement tool.

@kmurray
Copy link
Contributor

kmurray commented May 31, 2019

I agree cleaning up extra includes etc is good.

Any thoughts on just doing this periodically vs running on CI?

I know CI is going to be more consistent, but this does seem like a lower priority issue.

@mithro
Copy link
Contributor Author

mithro commented Jun 2, 2019

@kmurray Once it has been cleaned up, I think we should just run it as part of the C++ formatting check job.

@vaughnbetz
Copy link
Contributor

This makes sense to me. Tim, do you want to drive it? Happy to assign it to you, and put it in the C++ formatting check.

Copy link

This issue has been inactive for a year and has been marked as stale. It will be closed in 15 days if it continues to be stale. If you believe this is still an issue, please add a comment.

@github-actions github-actions bot added the Stale label Apr 30, 2025
Copy link

This issue has been marked stale for 15 days and has been automatically closed.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 15, 2025
@vaughnbetz vaughnbetz reopened this May 15, 2025
@vaughnbetz
Copy link
Contributor

This is a good idea ... @AmirhosseinPoolad discuss and see if you can take this one on.

@AmirhosseinPoolad AmirhosseinPoolad added no-stale Exclude issue from being automatically marked as stale and removed Stale labels May 15, 2025
@AlexandreSinger
Copy link
Contributor

I also agree that this is a good idea. I have found that several files in VTR have header files that they include which they do not use. This is most problematic in header files. Some header files include other header files that they do not use which causes a cascade of includes. This ultimately leads to a problem when modifying a single header file ends up causing practically all files in VTR to be rebuilt which is not ideal.

Transitive includes (including a header file that you do not use, but you use something that it includes) also has similar problems but are not nearly as bad, especially if we have already cleaned up truly unused header files.

I have this tool installed locally in my editor and have found that many files in VTR have includes which are unused. I have tried removing them when I can, but they are very tricky to remove due to header files including unused header files which many of the CPP files rely on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-stale Exclude issue from being automatically marked as stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants