Description
When we switch to a new version of Clang format, I currently always use -dump-config > .clang-format_new
in the folder where our currently used config file is located and then do a diff on the files to see what has changed since the last update, so I don't have to go through the changelogs of different versions (and the missing entries in them like the new TableGen options in the changelog of CF 19).
Clang-Format currently dumps all options, even if they are not relevant. For example, there are Java entries in the C++ block, which is currently not so easy to recognize (see also #134390).
So the dumped file looks, e.g., like:
---
Language: Cpp
# ...
AllowShortCaseExpressionOnASingleLine: true
# ...
...
As the yml files supports multiple languages within a single config file, I would expect sth. like this:
---
Language: Cpp
# ...
---
Language: Java
AllowShortCaseExpressionOnASingleLine: true
# ...
...
So I suggest improving -dump-config
by following things:
- In case
LanguageKind
isNone
it could still print all options within this block - If a specific language (or multiple) is configured, only output options for this language (filtering) within the block.
- In case there is a
None
-Language-Block and a (or multiple) specific blocks: In case an option is just for a specific language, add the option just in this block, otherwise in the general block.