[PATCH] D53339: [clang-tidy] Add the abseil-duration-factory-float check
Hyrum Wright via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 24 05:51:15 PDT 2018
hwright added inline comments.
================
Comment at: clang-tidy/abseil/AbseilTidyModule.cpp:32
+ CheckFactories.registerCheck<DurationFactoryFloatCheck>(
+ "abseil-duration-factory-float");
CheckFactories.registerCheck<FasterStrsplitDelimiterCheck>(
----------------
hokein wrote:
> Maybe drop the `factory`? we already have a duration-related check `abseil-duration-division`, for consistency.
>
> `clang-tidy/rename_check.py` may help you.
The expectation is that there may be other checks relating to calls to duration factories, beyond just floating point literal and cast simplification.
Though I'm happy to be convinced otherwise.
================
Comment at: clang-tidy/abseil/DurationFactoryFloatCheck.cpp:94
+ diag(MatchedCall->getBeginLoc(),
+ (llvm::Twine("Use integer version of absl::") +
+ MatchedCall->getDirectCallee()->getName())
----------------
hokein wrote:
> nit: clang-tidy message is not a complete sentence, use lower letter `use`.
This is a complete sentence, in the imperative style of other clang-tidy checks. I've added a full-stop at the end.
https://reviews.llvm.org/D53339
More information about the cfe-commits
mailing list