From d20cebb3b4d7ec1a7ae994523e4c234dbe336eec Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Mon, 9 Mar 2020 17:02:47 -0700 Subject: [PATCH] Fix some stylistic issues --- src/compiler/python_generator.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/compiler/python_generator.cc b/src/compiler/python_generator.cc index 40a77543203..8db9825827e 100644 --- a/src/compiler/python_generator.cc +++ b/src/compiler/python_generator.cc @@ -70,10 +70,16 @@ typedef set StringPairSet; class IndentScope { public: explicit IndentScope(grpc_generator::Printer* printer) : printer_(printer) { + // NOTE(rbellevi): Two-space tabs are hard-coded in the protocol compiler. + // Doubling our indents and outdents guarantees compliance with PEP8. + printer_->Indent(); printer_->Indent(); } - ~IndentScope() { printer_->Outdent(); } + ~IndentScope() { + printer_->Outdent(); + printer_->Outdent(); + } private: grpc_generator::Printer* printer_; @@ -92,8 +98,7 @@ void PrivateGenerator::PrintAllComments(StringVector comments, // smarter and more sophisticated, but at the moment, if there is // no docstring to print, we simply emit "pass" to ensure validity // of the generated code. - out->Print("# missing associated documentation comment in .proto file\n"); - out->Print("pass\n"); + out->Print("\"\"\"Missing associated documentation comment in .proto file\"\"\"\n"); return; } out->Print("\"\"\""); @@ -653,6 +658,7 @@ bool PrivateGenerator::PrintServiceClass( } } } + // TODO(rbellevi): Add methods pertinent to the server side as well. return true; }