[PATCH] D127446: [clang-tidy] Add `-verify-config` command line argument
Nathan James via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 22 02:46:31 PDT 2022
njames93 marked 4 inline comments as done.
njames93 added inline comments.
Comment at: clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp:263
+Check the config files to ensure each check and
+option is recognised.
Comment at: clang-tools-extra/test/clang-tidy/infrastructure/verify-config.cpp:12
+// CHECK-VERIFY-DAG: command-line option '-config': warning: Unknown Check 'readability-else-after-ret'; did you mean 'readability-else-after-return'
+// CHECK-VERIFY-DAG: command-line option '-config': warning: Unknown Check Option 'modernize-lop-convert.UseCxx20ReverseRanges'; did you mean 'modernize-loop-convert.UseCxx20ReverseRanges'
> It's unfortunate that `warning: ` appears in the middle of the diagnostic as opposed to at the start. I wonder if this can be reworked to say: `warning: Unknown check 'whatever'; did you mean 'whatever'? [-verify-config]` or something?
> Also, no test coverage for the error case and for the unknown check case where there's no closest match worth talking about.
Warning appearing in the middle is kind of by design as when clang emits diagnostics, the source location is the first thing emitted, then the type(warning|error). In this case `command-line option '-config'` is the "source location"
> Also, no test coverage for the error case.
I'm not 100% on that, there is no checking when the check glob is actually built and I haven't figured out how to break it.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the cfe-commits