felipeprov / include-what-you-use

Automatically exported from code.google.com/p/include-what-you-use
Other
0 stars 0 forks source link

fix_includes.py --comments should add comments even if the actual includes didn't change #75

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?  Give the *exact* arguments passed
to include-what-you-use, and attach the input source file that gives the
problem (minimal test-cases are much appreciated!)
1. Run iwyu on something, and update the file to match its recommendations.
2. Later on, run iwyu again, and feed the output to fix_includes.py --comments 
to add comments.
3. Nothing happens!  "(skipping /path/to/foo.cpp: iwyu reports no contentful 
changes)".  I don't want only "contentful" changes -- that's why I ran it with 
--comments!

Looking at the output of iwyu itself, it currently doesn't output anything for 
files it's already happy with.  It should change to output the contents again 
with comments if they don't already have comments.

What version of the product are you using? On what operating system?
LLVM r160007, iwyu r357, Ubuntu 12.04 LTS x86.

Original issue reported on code.google.com by a...@aryeh.name on 11 Jul 2012 at 12:42

GoogleCodeExporter commented 8 years ago
Agree. I wish I knew how to make it so.

Maybe IWYU itself needs a --force-comments argument to always output comments. 
Not everyone uses the convention with comments on #include lines, so I don't 
think we want to force it onto an otherwise IWYU-correct codebase.

fix_includes.py probably does the right thing, since the IWYU output didn't 
produce any diff.

I'm tempted to make this an enhancement, as it's not strictly IWYU, more WWII: 
Why Was It Included :-)

Original comment by kim.gras...@gmail.com on 16 Sep 2012 at 5:05