[all-commits] [llvm/llvm-project] abbe9e: [clang-tidy] Added command line option `fix-notes`

Nathan James via All-commits all-commits at lists.llvm.org
Mon Mar 1 14:07:33 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: abbe9e227ed31e5dde9bb7567bb9f0dd047689c6
      https://github.com/llvm/llvm-project/commit/abbe9e227ed31e5dde9bb7567bb9f0dd047689c6
  Author: Nathan James <n.james93 at hotmail.co.uk>
  Date:   2021-03-01 (Mon, 01 Mar 2021)

  Changed paths:
    M clang-tools-extra/clang-tidy/ClangTidy.cpp
    M clang-tools-extra/clang-tidy/ClangTidy.h
    M clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
    M clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h
    M clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/docs/clang-tidy/index.rst
    M clang-tools-extra/test/clang-tidy/checkers/misc-definitions-in-headers.hpp
    M clang-tools-extra/test/clang-tidy/checkers/misc-unused-using-decls-cxx17.cpp
    M clang-tools-extra/test/clang-tidy/checkers/misc-unused-using-decls.cpp
    M clang-tools-extra/test/clang-tidy/checkers/readability-inconsistent-declaration-parameter-name.cpp
    M clang-tools-extra/test/clang-tidy/infrastructure/alternative-fixes.cpp
    M clang-tools-extra/test/clang-tidy/infrastructure/clean-up-code.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list