IWYU cleanup done
This commit is contained in:
50
Docs/TASKS/IWYU.md
Normal file
50
Docs/TASKS/IWYU.md
Normal file
@@ -0,0 +1,50 @@
|
||||
Your job is to remove unnecessary include-files from a
|
||||
single C++ source file in UE Wingman, and also, add missing
|
||||
includes.
|
||||
|
||||
Remember: not all removals that compile are good according
|
||||
to the principles of IWYU. A source file should include or
|
||||
forward-define everything it uses, and should include
|
||||
nothing that it doesn't. You will need to think seriously.
|
||||
|
||||
To test your work, you will need to do a build:
|
||||
|
||||
python3 build.py c++
|
||||
|
||||
followed by:
|
||||
|
||||
tools/clangd-query.py diagnostics <file>
|
||||
|
||||
Sometimes, clangd gets desynchronized. If clangd is
|
||||
reporting an error on UCLASS or on GENERATED_BODY after a
|
||||
successful build, then clangd is out of sync. In that case,
|
||||
you will need to refresh clangd:
|
||||
|
||||
tools/clangd-query.py stop
|
||||
|
||||
Then you can try again with the diagnostics. If the testing
|
||||
reveals a mistake, please fix it and then redo the testing.
|
||||
|
||||
Start by reading the head of TODO.txt, which lists the files
|
||||
that need to be cleaned. Please clean up the first file on
|
||||
the todo list, then remove that one file from the todo list.
|
||||
Then you are done.
|
||||
|
||||
One special exception to IWYU: all unreal code should include
|
||||
CoreMinimal.h, no matter what.
|
||||
|
||||
There is no need to run clangd before you begin. These
|
||||
files are already clangd-clean.
|
||||
|
||||
Do not be chatty about it. Just begin, get it cleaned, and
|
||||
then very concisely report your results. And once again: do
|
||||
not forget the principle of IWYU: not all removals that
|
||||
compile are good. If a file is using a symbol, it should
|
||||
include it or forward-define it, not rely on transitive
|
||||
includes. Remove what should be removed, add what should be
|
||||
added.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user