[clang-tidy] Extend spelling for CheckOptions
authorNathan James <n.james93@hotmail.co.uk>
Thu, 23 Jun 2022 18:59:30 +0000 (19:59 +0100)
committerNathan James <n.james93@hotmail.co.uk>
Thu, 23 Jun 2022 18:59:31 +0000 (19:59 +0100)
commitfbf611ed2a768999202e2c5e1e1a6c3c6bb94725
tree0b6fc6464d5bd940c1cbc37860b528aff882b8bd
parent148071fbae3f9a1015969376a75a47d433c49a13
[clang-tidy] Extend spelling for CheckOptions

The current way to specify CheckOptions is pretty verbose and unintuitive.
Given that the options are a dictionary it makes much more sense to treat them as such in the config files.
Example:
```
CheckOptions: {SomeCheck.Option: true, SomeCheck.OtherOption: 'ignore'}
# Or
CheckOptions:
  SomeCheck.Option: true
  SomeCheck.OtherOption: 'ignore'
```

This change will still handle the old syntax with no issue, ensuring we don't screw up users current config files.

The only observable differences are support for the new syntax and `-dump=config` will emit using the new syntax.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D128337
clang-tools-extra/clang-tidy/ClangTidyOptions.cpp
clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
clang-tools-extra/clangd/unittests/TidyProviderTests.cpp
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/Contributing.rst
clang-tools-extra/docs/clang-tidy/index.rst
clang-tools-extra/test/clang-tidy/checkers/google/module.cpp
clang-tools-extra/test/clang-tidy/infrastructure/Inputs/config-files/4/key-dict/.clang-tidy [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/infrastructure/config-files.cpp