[PATCH] D97121: [clang-tidy] Add a single fix mode to clang-tidy
Stephen Kelly via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 22 15:33:47 PST 2021
steveire added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/ClangTidyCheck.h:514
const LangOptions &getLangOpts() const { return Context->getLangOpts(); }
+ /// Returns true when the check is ran in a use case when only 1 fix will be
+ /// applied at a time.
----------------
Very minor, but I think this should be `run`.
================
Comment at: clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp:81
+ if (InsertedHeaders[FileID].contains(Header))
+ return llvm::None;
+ } else if (!InsertedHeaders[FileID].insert(Header).second)
----------------
The comment and the code seem to me to be opposites. The code says "if `SingleFixMode` is true and we have already inserted the header, don't insert it again." The comment says that "`SingleFixMode` does not prevent inserting it again" -- The comment seems to be the opposite of the code?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97121/new/
https://reviews.llvm.org/D97121
More information about the cfe-commits
mailing list