[PATCH] D57674: [clang-tidy] Add options to bugprone-argument-comment to add missing argument comments to literals

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 4 02:13:18 PST 2019


MyDeveloperDay created this revision.
MyDeveloperDay added reviewers: JonasToth, alexfh, hokein, aaron.ballman, Eugene.Zelenko.
MyDeveloperDay added a project: clang-tools-extra.
Herald added a subscriber: xazax.hun.
Herald added a project: clang.

bugprone-argument-comment only supports identifying those comments which do not match the function parameter name

This revision add 3 options to adding missing argument comments to literals (granularity on type is added to control verbosity of fixit)

  CheckOptions:
    - key:             bugprone-argument-comment.AddCommentsToBoolLiterals
      value:           '1'
    - key:             bugprone-argument-comment.AddCommentsToFloatLiterals
      value:           '1'
    - key:             bugprone-argument-comment.AddCommentsToIntegerLiterals
      value:           '1'

After applying these options, literal arguments will be preceded with /*paramter_name=*/


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D57674

Files:
  clang-tidy/bugprone/ArgumentCommentCheck.cpp
  clang-tidy/bugprone/ArgumentCommentCheck.h
  docs/ReleaseNotes.rst
  docs/clang-tidy/checks/bugprone-argument-comment.rst
  test/clang-tidy/bugprone-argument-comment-literals.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57674.185008.patch
Type: text/x-patch
Size: 8716 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190204/8c09b702/attachment-0001.bin>


More information about the cfe-commits mailing list