[all-commits] [llvm/llvm-project] c47c48: [clang-format][NFC] Fix broken dump_format_help.py...

Owen via All-commits all-commits at lists.llvm.org
Thu Sep 7 00:43:32 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c47c480b1845c27693f95d4ec8f3373898e99365
      https://github.com/llvm/llvm-project/commit/c47c480b1845c27693f95d4ec8f3373898e99365
  Author: Owen <owenpiano at gmail.com>
  Date:   2023-09-07 (Thu, 07 Sep 2023)

  Changed paths:
    M clang/docs/ClangFormat.rst
    M clang/docs/tools/dump_format_help.py
    M clang/tools/clang-format/ClangFormat.cpp

  Log Message:
  -----------
  [clang-format][NFC] Fix broken dump_format_help.py and sync RST file (#65429)

Running `dump_format_help.py` in `clang/docs/tools`:
```
warning: line too long:
                                      relative to the current working directory when reading stdin.
warning: line too long:
     --files=<filename>             - A file containing a list of files to process, one per line.
warning: line too long:
     --help-list                    - Display list of available options (--help-list-hidden for more)
Traceback (most recent call last):
  File "/Users/Owen/remove-braces/clang/docs/tools/./dump_format_help.py", line 63, in <module>
    contents = substitute(contents, "FORMAT_HELP", help_text)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Owen/remove-braces/clang/docs/tools/./dump_format_help.py", line 17, in substitute
    return re.sub(pattern, "%s", text, flags=re.S) % replacement
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
TypeError: not enough arguments for format string
```




More information about the All-commits mailing list