[all-commits] [llvm/llvm-project] 73e4b5: [clang-tidy] Add 'readability-suspicious-call-argu...

Whisperity via All-commits all-commits at lists.llvm.org
Mon Jul 19 01:19:29 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 73e4b5cfa8ea6dda3624e03beb60827db12bb3a3
      https://github.com/llvm/llvm-project/commit/73e4b5cfa8ea6dda3624e03beb60827db12bb3a3
  Author: Whisperity <whisperity at gmail.com>
  Date:   2021-07-19 (Mon, 19 Jul 2021)

  Changed paths:
    M clang-tools-extra/clang-tidy/readability/CMakeLists.txt
    M clang-tools-extra/clang-tidy/readability/ReadabilityTidyModule.cpp
    A clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp
    A clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.h
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/docs/clang-tidy/checks/list.rst
    A clang-tools-extra/docs/clang-tidy/checks/readability-suspicious-call-argument.rst
    A clang-tools-extra/test/clang-tidy/checkers/readability-suspicious-call-argument.cpp
    M llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/readability/BUILD.gn

  Log Message:
  -----------
  [clang-tidy] Add 'readability-suspicious-call-argument' check

Finds function calls where the call arguments might be provided in an
incorrect order, based on the comparison (via string metrics) of the
parameter names and the argument names against each other.

A diagnostic is emitted if an argument name is similar to a *different*
parameter than the one currently passed to, and it is sufficiently
dissimilar to the one it **is** passed to currently.

False-positive warnings from this check are useful to indicate bad
naming convention issues, even if a swap isn't necessary.
This check does not generate FixIts.

Originally implemented by @varjujan as his Master's Thesis work.
The check was subsequently taken over by @barancsuk who added type
conformity checks to silence false positive matches.
The work by @whisperity involved driving the check's review and fixing
some more bugs in the process.

Reviewed By: aaron.ballman, alexfh

Differential Revision: http://reviews.llvm.org/D20689

Co-authored-by: János Varjú <varjujanos2 at gmail.com>
Co-authored-by: Lilla Barancsuk <barancsuklilla at gmail.com>




More information about the All-commits mailing list