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
[RFE] An option to only show lines for removal #711
Comments
For your β -- the added headers are not the same as the removed headers. IWYU blindly suggests adding the header that defines a symbol, it doesn't know that Qt has a facade header convention where But I think the remove-only mode sounds interesting. Could you take a stab at a proof-of-concept patch? |
Thank you!
This sounds interesting, but I don't think I will do this anytime soon. But thank you for the interest, I'll bear it in mind, so depending on circumstances, I may take a stab at it. |
@kimgr I am also interested in using iwyu as a unnecessary includes linter. 'don't-include-what-you-don't-use' I tried removing the parsing of header additions in |
@GilesBathgate Yes, most of the analysis is done by include-what-you-use proper. The fix_includes script only tries to do safe edits based on its output. |
Problem
While trying to use the tool to get rid of unused includes in Konsole sources, I found it very tedious to use. These 6 commits took, I think, about 2 hours of my time.
There are 2 reasons it took so much time: α) false-positives, β) it suggests to remove the same headers as it suggested to add. A typical IWYU output for konsole project:
Quiz question: how many includes does it suggest to remove?
Answer: none. Every header it suggested to remove was actually moved to the
should add these lines
part.As results, using IWYU is pretty tedious. I though I might be using it wrong, so I googled up, and found this blogpost from 2013, last 2 paragraphs of which suggests it was always like this to use.
Solution
An option to only show lines that can be removed without adding any would greatly help.
The text was updated successfully, but these errors were encountered: