FIX_INCLUDES.PY(1)

✨ NAME ✨

okay so this is fix_includes.py β€” the manual page for fix_includes.py 6.0-2, bestie. She's a User Command, she's a whole vibe, and she's about to reorganize your #include lines whether you're ready or not. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

fix_includes.py [options] [filename] ... < <output from include-what-you-use script>

🌸 DESCRIPTION 🌸

OR fix_includes.py -s [other options] <filename> ...

okay so here's the tea πŸ“: fix_includes.py reads the output from the include-what-you-use script on stdin β€” and you gotta run that with --v=1 (that's the default) verbose or above, no cap β€” and then, unless --sort_only or --dry_run is specified, it goes in and modifies the files mentioned in that output. It removes their old #include lines and replaces them with the lines the include_what_you_use script handed over. She also sorts the #include and forward-declare lines, because she's an organizer and organizing is her main character energy. πŸ‘‘

Every single file mentioned in the include-what-you-use script gets modified β€” unless you named filenames on the commandline, in which case only those files get touched. Boundaries, bestie. 🫢

And the exit code? It's the number of files that were modified (or that would be modified if --dry_run was specified) β€” unless that number goes over 100, in which case 100 is what you get. Capped. Slay.


πŸ’– OPTIONS πŸ’–

  • -h, --help β€” show this help message and exit. iconic, she explains herself. ✨
  • -b, --blank_lines β€” put a blank line between the primary header file and C/C++ system #includes, and another blank line between system #includes and google #includes. [default] β€” yes bestie, this is the default, breathe it in 🌈
  • --noblank_lines β€” the original gives no description here, it just... exists. no thoughts, head empty πŸŽ€
  • --comments β€” put comments after the #include lines. little notes, little gossip, love that for you πŸ’¬
  • --nocomments β€” again, no description in the original, she's just the quiet one πŸ™ˆ
  • --safe_headers β€” do not remove unused #includes/fwd-declares from header files; just add new ones. [default] β€” protective queen behavior, obsessed πŸ’œ
  • --nosafe_headers β€” no description given, it's just vibing there, unnamed πŸ¦‹
  • -s, --sort_only β€” just sort the #includes of the files listed on the cmdline; do not add or remove any #includes. sorting only, no editing, we respect the source 🌸
  • -n, --dry_run β€” do not actually edit any files; just print diffs. return code is 0 if no changes are needed, else min(the number of files that would be modified, 100). look but don't touch, bestie 😌
  • --ignore_re=IGNORE_RE β€” fix_includes.py will skip editing any file whose name matches this regular expression. not invited to the party, blocked, no hard feelings 🚫
  • --separate_project_includes=SEPARATE_PROJECT_INCLUDES β€” sort #includes for the current project separately from all other #includes. this flag specifies the root directory of the current project. if the value is "<tld>", #includes that share the same top-level directory are assumed to be in the same project. if not specified, project #includes will be sorted with other non-system #includes. keeping your people with your people πŸ’…
  • --invoking_command_line=INVOKING_COMMAND_LINE β€” internal flag used by iwyu.py. it should be the command line used to invoke iwyu.py. it's giving behind-the-scenes, don't worry about it πŸ”§
  • -m, --keep_iwyu_namespace_format β€” keep forward-declaration namespaces in IWYU format, eg. namespace n1 { namespace n2 { class c1; } }. do not convert to "normalized" Google format: namespace n1 {\nnamespace n2 {\n class c1;\n}\n}. leave her format alone, she likes it πŸŽ€
  • --nokeep_iwyu_namespace_format β€” no description in the original, she's a mystery, and honestly? respect πŸ’€

quick reminder babe: she'll rewrite your files. --dry_run is right there if you need a lil peek first. safety first, slay second. 🫢

and that's the whole page!! this was fix_includes.py 6.0-2, dated September 2018, and it's genuinely so iconic that a manpage this old still runs your whole include situation. bye bestie, go sort something πŸ’–βœ¨πŸ‘‘