llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.6k stars 11.82k forks source link

clang-include-cleaner - not clear documentation #68200

Open PiotrZSL opened 1 year ago

PiotrZSL commented 1 year ago
USAGE: clang-include-cleaner [options] <source0> [... <sourceN>]

OPTIONS:

Generic Options:

  --help                      - Display available options (--help-hidden for more)
  --help-list                 - Display list of available options (--help-list-hidden for more)
  --version                   - Display the version of this program

clang-include-cleaner:

  --edit                      - Apply edits to analyzed source files
  --extra-arg=<string>        - Additional argument to append to the compiler command line
  --extra-arg-before=<string> - Additional argument to prepend to the compiler command line
  --html=<string>             - Specify an output filename for an HTML report. This describes both recommendations and reasons for changes.
  --ignore-headers=<string>   - A comma-separated list of regexes to match against suffix of a header, and disable analysis if matched.
  --insert                    - Allow header insertions
  -p <string>                 - Build path
  --print                     - Print the list of headers to insert and remove
  --print=<value>             - Print the list of headers to insert and remove
    =changes                  -   Print symbolic changes
    =<empty>                  -   Print final code
  --remove                    - Allow header removals

--remove and --insert are enabled by default, so only way to disable for example header insertion is to use --insert=false. This is not clear based on above help. I would assume that using only --remove should do the same, but does not.

llvmbot commented 1 year ago

@llvm/issue-subscribers-clang-include-cleaner

``` USAGE: clang-include-cleaner [options] <source0> [... <sourceN>] OPTIONS: Generic Options: --help - Display available options (--help-hidden for more) --help-list - Display list of available options (--help-list-hidden for more) --version - Display the version of this program clang-include-cleaner: --edit - Apply edits to analyzed source files --extra-arg=<string> - Additional argument to append to the compiler command line --extra-arg-before=<string> - Additional argument to prepend to the compiler command line --html=<string> - Specify an output filename for an HTML report. This describes both recommendations and reasons for changes. --ignore-headers=<string> - A comma-separated list of regexes to match against suffix of a header, and disable analysis if matched. --insert - Allow header insertions -p <string> - Build path --print - Print the list of headers to insert and remove --print=<value> - Print the list of headers to insert and remove =changes - Print symbolic changes =<empty> - Print final code --remove - Allow header removals ``` --remove and --insert are enabled by default, so only way to disable for example header insertion is to use --insert=false. This is not clear based on above help. I would assume that using only --remove should do the same, but does not.
PiotrZSL commented 1 year ago

Other bug, using only --remove=true --insert=false leaves files not compliable when one header file is being replaced with other.

Example: changing boost/fusion/include/equal_to.hpp to boost/fusion/sequence/comparison/equal_to.hpp