[clang-tidy] Added command line option `fix-notes`
authorNathan James <n.james93@hotmail.co.uk>
Mon, 1 Mar 2021 22:07:09 +0000 (22:07 +0000)
committerNathan James <n.james93@hotmail.co.uk>
Mon, 1 Mar 2021 22:07:11 +0000 (22:07 +0000)
commitabbe9e227ed31e5dde9bb7567bb9f0dd047689c6
treeb4f6eec6ecc977804f1eb9c08657eabf9b3437c2
parent0131498402acbae4cfb445a5a98fcf93b3a0e676
[clang-tidy] Added command line option `fix-notes`

Added an option to control whether to apply the fixes found in notes attached to clang tidy errors or not.
Diagnostics may contain multiple notes each offering different ways to fix the issue, for that reason the default behaviour should be to not look at fixes found in notes.
Instead offer up all the available fix-its in the output but don't try to apply the first one unless `-fix-notes` is supplied.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D84924
13 files changed:
clang-tools-extra/clang-tidy/ClangTidy.cpp
clang-tools-extra/clang-tidy/ClangTidy.h
clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h
clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/index.rst
clang-tools-extra/test/clang-tidy/checkers/misc-definitions-in-headers.hpp
clang-tools-extra/test/clang-tidy/checkers/misc-unused-using-decls-cxx17.cpp
clang-tools-extra/test/clang-tidy/checkers/misc-unused-using-decls.cpp
clang-tools-extra/test/clang-tidy/checkers/readability-inconsistent-declaration-parameter-name.cpp
clang-tools-extra/test/clang-tidy/infrastructure/alternative-fixes.cpp
clang-tools-extra/test/clang-tidy/infrastructure/clean-up-code.cpp