Hi,
When for simple options I agree that new format of config is easier, it’s not easier for checks.
Examples (Clang 16):
Old way:
- key: something-forbidden-apis.ForbiddenFunctions
value: |
---
- name: abort
warningText: forbidden api call 'abort'
headers:
- cstdlib
- stdlib.h
- name: printf
warningText: forbidden api call 'printf'
New way (dump):
something-forbidden-apis.ForbiddenFunctions: "---\n - name: abort\n warningText: forbidden api call 'abort'\n headers:\n - cstdlib\n - stdlib.h\n - name: printf\n warningText: forbidden api call 'printf'\n"
Of course dump were broken even before with:
- key: something-forbidden-apis.ForbiddenFunctions
value: "---\n - name: abort\n warningText: forbidden api call 'abort'\n headers:\n - cstdlib\n - stdlib.h\n - name: printf\n
This mean that not only basic clang-tidy config file need to switch to new format, but also invidual checks need to switch into new format. And to make config output readable some support would be required for multi-line format.
Other problem is that current config format is custom one, it’s not yaml, its not json, who knows what it is, and as a result you get dump like:
misc-definitions-in-headers.HeaderFileExtensions: h,hh,hpp,hxx
bugprone-suspicious-include.ImplementationFileExtensions: 'c;cc;cpp;cxx'
and start asking your self, what it is ? string or list.
For me clang-tidy just should switch from yaml to json (full json), but now we stuck somewere in between with this trash. Thats why I do not plan to use new format and stick with yaml thats more readable. And this is a reason why old format shouldn’t be deprecated.
For me to make this work it would need to work with structures in readable way.
Both in dump and in input file with easy support for checks (some examples).
If you look over internet then all examples are using old yaml format.
In summary: -1 from me for now