[clang-tools-extra] r371076 - [clang-tidy] Make most ArgumentCommentCheck options local, as they should be
Alexander Kornienko via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 5 07:48:31 PDT 2019
Author: alexfh
Date: Thu Sep 5 07:48:31 2019
New Revision: 371076
URL: http://llvm.org/viewvc/llvm-project?rev=371076&view=rev
Log:
[clang-tidy] Make most ArgumentCommentCheck options local, as they should be
Modified:
clang-tools-extra/trunk/clang-tidy/bugprone/ArgumentCommentCheck.cpp
clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-ignore-single-argument.cpp
clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-literals.cpp
Modified: clang-tools-extra/trunk/clang-tidy/bugprone/ArgumentCommentCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/ArgumentCommentCheck.cpp?rev=371076&r1=371075&r2=371076&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/ArgumentCommentCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/ArgumentCommentCheck.cpp Thu Sep 5 07:48:31 2019
@@ -25,19 +25,14 @@ ArgumentCommentCheck::ArgumentCommentChe
: ClangTidyCheck(Name, Context),
StrictMode(Options.getLocalOrGlobal("StrictMode", 0) != 0),
IgnoreSingleArgument(Options.get("IgnoreSingleArgument", 0) != 0),
- CommentBoolLiterals(Options.getLocalOrGlobal("CommentBoolLiterals", 0) !=
- 0),
- CommentIntegerLiterals(
- Options.getLocalOrGlobal("CommentIntegerLiterals", 0) != 0),
- CommentFloatLiterals(
- Options.getLocalOrGlobal("CommentFloatLiterals", 0) != 0),
- CommentStringLiterals(
- Options.getLocalOrGlobal("CommentStringLiterals", 0) != 0),
- CommentUserDefinedLiterals(
- Options.getLocalOrGlobal("CommentUserDefinedLiterals", 0) != 0),
- CommentCharacterLiterals(
- Options.getLocalOrGlobal("CommentCharacterLiterals", 0) != 0),
- CommentNullPtrs(Options.getLocalOrGlobal("CommentNullPtrs", 0) != 0),
+ CommentBoolLiterals(Options.get("CommentBoolLiterals", 0) != 0),
+ CommentIntegerLiterals(Options.get("CommentIntegerLiterals", 0) != 0),
+ CommentFloatLiterals(Options.get("CommentFloatLiterals", 0) != 0),
+ CommentStringLiterals(Options.get("CommentStringLiterals", 0) != 0),
+ CommentUserDefinedLiterals(Options.get("CommentUserDefinedLiterals", 0) !=
+ 0),
+ CommentCharacterLiterals(Options.get("CommentCharacterLiterals", 0) != 0),
+ CommentNullPtrs(Options.get("CommentNullPtrs", 0) != 0),
IdentRE("^(/\\* *)([_A-Za-z][_A-Za-z0-9]*)( *= *\\*/)$") {}
void ArgumentCommentCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
Modified: clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-ignore-single-argument.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-ignore-single-argument.cpp?rev=371076&r1=371075&r2=371076&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-ignore-single-argument.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-ignore-single-argument.cpp Thu Sep 5 07:48:31 2019
@@ -1,5 +1,13 @@
// RUN: %check_clang_tidy %s bugprone-argument-comment %t -- \
-// RUN: -config="{CheckOptions: [{key: bugprone-argument-comment.IgnoreSingleArgument, value: 1}, {key: CommentBoolLiterals, value: 1},{key: CommentIntegerLiterals, value: 1}, {key: CommentFloatLiterals, value: 1}, {key: CommentUserDefinedLiterals, value: 1}, {key: CommentStringLiterals, value: 1}, {key: CommentNullPtrs, value: 1}, {key: CommentCharacterLiterals, value: 1}]}" --
+// RUN: -config="{CheckOptions: [ \
+// RUN: {key: bugprone-argument-comment.IgnoreSingleArgument, value: 1}, \
+// RUN: {key: bugprone-argument-comment.CommentBoolLiterals, value: 1}, \
+// RUN: {key: bugprone-argument-comment.CommentIntegerLiterals, value: 1}, \
+// RUN: {key: bugprone-argument-comment.CommentFloatLiterals, value: 1}, \
+// RUN: {key: bugprone-argument-comment.CommentUserDefinedLiterals, value: 1}, \
+// RUN: {key: bugprone-argument-comment.CommentStringLiterals, value: 1}, \
+// RUN: {key: bugprone-argument-comment.CommentNullPtrs, value: 1}, \
+// RUN: {key: bugprone-argument-comment.CommentCharacterLiterals, value: 1}]}" --
struct A {
void foo(bool abc);
Modified: clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-literals.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-literals.cpp?rev=371076&r1=371075&r2=371076&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-literals.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/bugprone-argument-comment-literals.cpp Thu Sep 5 07:48:31 2019
@@ -1,5 +1,12 @@
// RUN: %check_clang_tidy %s bugprone-argument-comment %t -- \
-// RUN: -config="{CheckOptions: [{key: CommentBoolLiterals, value: 1},{key: CommentIntegerLiterals, value: 1}, {key: CommentFloatLiterals, value: 1}, {key: CommentUserDefinedLiterals, value: 1}, {key: CommentStringLiterals, value: 1}, {key: CommentNullPtrs, value: 1}, {key: CommentCharacterLiterals, value: 1}]}" --
+// RUN: -config="{CheckOptions: [ \
+// RUN: {key: bugprone-argument-comment.CommentBoolLiterals, value: 1}, \
+// RUN: {key: bugprone-argument-comment.CommentIntegerLiterals, value: 1}, \
+// RUN: {key: bugprone-argument-comment.CommentFloatLiterals, value: 1}, \
+// RUN: {key: bugprone-argument-comment.CommentUserDefinedLiterals, value: 1}, \
+// RUN: {key: bugprone-argument-comment.CommentStringLiterals, value: 1}, \
+// RUN: {key: bugprone-argument-comment.CommentNullPtrs, value: 1}, \
+// RUN: {key: bugprone-argument-comment.CommentCharacterLiterals, value: 1}]}" --
struct A {
void foo(bool abc);
More information about the cfe-commits
mailing list