owenca wrote:
Running the new clang-format from this patch on `clang/tools/clang-format/`
results in the following:
```
$ clang-format -ir tools/clang-format
/llvm-project/clang/tools/clang-format/.clang-format:1:1: error: Unknown value
for BasedOnStyle: clang - format
BasedOnStyle : clang - format
^
Error reading /llvm-project/clang/tools/clang-format/.clang-format: Invalid
argument
/llvm-project/clang/tools/clang-format/.clang-format:1:1: error: Unknown value
for BasedOnStyle: clang - format
BasedOnStyle : clang - format
^
Error reading /llvm-project/clang/tools/clang-format/.clang-format: Invalid
argument
/llvm-project/clang/tools/clang-format/.clang-format:1:1: error: Unknown value
for BasedOnStyle: clang - format
BasedOnStyle : clang - format
^
Error reading /llvm-project/clang/tools/clang-format/.clang-format: Invalid
argument
/llvm-project/clang/tools/clang-format/.clang-format:1:1: error: Unknown value
for BasedOnStyle: clang - format
BasedOnStyle : clang - format
^
Error reading /llvm-project/clang/tools/clang-format/.clang-format: Invalid
argument
$ git status
On branch pr160299
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: tools/clang-format/.clang-format
modified: tools/clang-format/CMakeLists.txt
modified: tools/clang-format/clang-format-diff.py
modified: tools/clang-format/clang-format-test.el
modified: tools/clang-format/clang-format.el
modified: tools/clang-format/clang-format.py
modified: tools/clang-format/fuzzer/CMakeLists.txt
modified: tools/clang-format/git-clang-format.bat
```
This is not very helpful and can be dangerous. IMO clang-format should keep
treating directories as invalid filenames:
```
$ clang-format -i tools/clang-format
tools/clang-format: Is a directory
$ echo $?
1
```
BTW, you can recursively list all files under a directory with `dir /S /B` in
CMD on Windows. So I would recommend using the `@<file>` or
`--files=<filename>` options for the purpose of formatting an entire directory.
https://github.com/llvm/llvm-project/pull/160299
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits