diff options
author | 2017-08-30 08:58:10 -0400 | |
---|---|---|
committer | 2017-08-30 13:16:12 +0000 | |
commit | a523d2d1554441a79319eb46960d7b5c2dc85d9d (patch) | |
tree | bea460eb96b0bec9d57093d159dff0fc74f9f0d7 /tools/bookmaker/bookmaker.cpp | |
parent | 4c6024afcce54cc775810b5f8ebccbcdbc6a43d7 (diff) |
fix param return descriptions
enforce that param and return
descriptions are phrases (begin
with lower case, no trailing
period).
Docs-Preview: https://skia.org/?cl=40767
Bug: skia: 6898
Change-Id: Ib5f2a02441673f71c0780d81c5e4c61200a678e3
Reviewed-on: https://skia-review.googlesource.com/40767
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'tools/bookmaker/bookmaker.cpp')
-rw-r--r-- | tools/bookmaker/bookmaker.cpp | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/tools/bookmaker/bookmaker.cpp b/tools/bookmaker/bookmaker.cpp index 0c23c7720a..b3d3190b78 100644 --- a/tools/bookmaker/bookmaker.cpp +++ b/tools/bookmaker/bookmaker.cpp @@ -28,6 +28,7 @@ enum comments should be disallowed unless after #Enum and before first #Const trouble with aliases, plurals need to keep first letter of includeWriter @param / @return lowercase Quad -> quad, Quads -> quads +check for summary containing all methods */ static string normalized_name(string name) { @@ -1028,16 +1029,8 @@ bool BmhParser::addDefinition(const char* defStart, bool hasEnd, MarkType markTy return false; } if (MarkType::kParam == markType || MarkType::kReturn == markType) { - const char* parmEndCheck = definition->fContentEnd; - while (parmEndCheck < definition->fTerminator) { - if (fMC == parmEndCheck[0]) { - break; - } - if (' ' < parmEndCheck[0]) { - this->reportError<bool>( - "use full end marker on multiline #Param and #Return"); - } - ++parmEndCheck; + if (!this->checkParamReturn(definition)) { + return false; } } } else { @@ -1225,6 +1218,21 @@ bool BmhParser::checkExamples() const { return checkOK; } +bool BmhParser::checkParamReturn(const Definition* definition) const { + const char* parmEndCheck = definition->fContentEnd; + while (parmEndCheck < definition->fTerminator) { + if (fMC == parmEndCheck[0]) { + break; + } + if (' ' < parmEndCheck[0]) { + this->reportError<bool>( + "use full end marker on multiline #Param and #Return"); + } + ++parmEndCheck; + } + return true; +} + bool BmhParser::childOf(MarkType markType) const { auto childError = [this](MarkType markType) -> bool { string errStr = "expected "; @@ -2181,7 +2189,7 @@ int main(int argc, char** const argv) { return 0; } if ((FLAGS_include.isEmpty() || FLAGS_bmh.isEmpty()) && FLAGS_populate) { - SkDebugf("-r requires -b -i\n"); + SkDebugf("-p requires -b -i\n"); SkCommandLineFlags::PrintUsage(); return 1; } |