[PATCH] D74669: [clang-tidy] New check: misc-no-include-cpp
Nathan James via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 27 13:05:52 PST 2020
njames93 added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/bugprone/SuspiciousIncludeCheck.cpp:44
+ RawStringRecommendedExtensions(Options.getLocalOrGlobal(
+ "RecommendedExtensions", utils::defaultHeaderFileExtensions())) {
+ if (!utils::parseFileExtensions(RawStringSuspiciousExtensions,
----------------
Follow the convention of the other checks and use `HeaderFileExtensions` as the option name. Probably call the other option `ImplementationFileExtensions`
================
Comment at: clang-tools-extra/clang-tidy/utils/FileExtensionsUtils.cpp:42
+ StringRef Extension = Suffix.trim();
+ for (StringRef::const_iterator it = Extension.begin();
+ it != Extension.end(); ++it) {
----------------
This could be changed to
```
if (!llvm::all_of(Extension, isAlphanumeric))
return false;
```
================
Comment at: clang-tools-extra/clang-tidy/utils/FileExtensionsUtils.h:38
+/// extensions.
+inline StringRef defaultHeaderFileExtensions() { return ",h,hh,hpp,hxx"; }
+
----------------
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
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74669/new/
https://reviews.llvm.org/D74669
More information about the cfe-commits
mailing list