[PATCH] D74669: [clang-tidy] New check: bugprone-suspicious-include

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 5 02:14:08 PST 2020


lebedev.ri added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/utils/FileExtensionsUtils.h:38
+/// extensions.
+inline StringRef defaultHeaderFileExtensions() { return ",h,hh,hpp,hxx"; }
+
----------------
njames93 wrote:
> lebedev.ri wrote:
> > njames93 wrote:
> > > A lot of configuration options for clang tidy use semi-colon `;` seperated lists. Would it not be wise to carry on the convention and use semi colon here (and below) as well. It could break a few peoples configuration but that would be realised  fairly quickly and updated
> > I think i'm missing the point of D75621.
> > Why can't we keep using `,` as delimitter?
> > Why do we have to change everything, introduce inconsistency
> > (is it still documented that `,` is still valid?),
> > and spam into terminal if `,` is found?
> This reason
> ```
> ➜  ~ clang-tidy test.cpp --config="{CheckOptions: [{ key: HeaderFileExtensions, value: h,,hpp,hxx }]}" -- -std=c++17
> YAML:1:59: error: unknown key 'hpp'
> {CheckOptions: [{ key: HeaderFileExtensions, value: h,,hpp,hxx }]}
>                                                           ^
> Error: invalid configuration specified.
> Invalid argument
> ➜  ~ clang-tidy test.cpp --config="{CheckOptions: [{ key: HeaderFileExtensions, value: h;;hpp;hxx }]}" -- -std=c++17
> ➜  ~ 
> 
> ```
```
$ clang-tidy test.cpp --config="{CheckOptions: [{ key: HeaderFileExtensions, value: h,,hpp,hxx }]}" -- -std=c++17
YAML:1:59: error: unknown key 'hpp'
{CheckOptions: [{ key: HeaderFileExtensions, value: h,,hpp,hxx }]}
                                                          ^
Error: invalid configuration specified.
Invalid argument
$ clang-tidy test.cpp --config="{CheckOptions: [{ key: HeaderFileExtensions, value: \"h,,hpp,hxx\" }]}" -- -std=c++17
Error while processing /repositories/llvm-project/test.cpp.
error: no input files [clang-diagnostic-error]
error: no such file or directory: '/repositories/llvm-project/test.cpp' [clang-diagnostic-error]
error: unable to handle compilation, expected exactly one compiler job in '' [clang-diagnostic-error]
Found compiler error(s).

```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74669/new/

https://reviews.llvm.org/D74669





More information about the cfe-commits mailing list