[PATCH] D53339: [clang-tidy] Add the abseil-duration-factory-float check

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 24 02:31:18 PDT 2018


hokein added a comment.

looks good, just a few nits.



================
Comment at: clang-tidy/abseil/AbseilTidyModule.cpp:32
+    CheckFactories.registerCheck<DurationFactoryFloatCheck>(
+        "abseil-duration-factory-float");
     CheckFactories.registerCheck<FasterStrsplitDelimiterCheck>(
----------------
Maybe drop the `factory`? we already have a duration-related check  `abseil-duration-division`, for consistency. 

`clang-tidy/rename_check.py` may help you.


================
Comment at: clang-tidy/abseil/DurationFactoryFloatCheck.cpp:94
+      diag(MatchedCall->getBeginLoc(),
+           (llvm::Twine("Use integer version of absl::") +
+            MatchedCall->getDirectCallee()->getName())
----------------
nit: clang-tidy message is not a complete sentence, use lower letter `use`.


https://reviews.llvm.org/D53339





More information about the cfe-commits mailing list