Fix some stylistic issues

pull/22218/head
Richard Belleville 5 years ago
parent c0b9694e4f
commit d20cebb3b4
  1. 12
      src/compiler/python_generator.cc

@ -70,10 +70,16 @@ typedef set<StringPair> StringPairSet;
class IndentScope { class IndentScope {
public: public:
explicit IndentScope(grpc_generator::Printer* printer) : printer_(printer) { 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(); printer_->Indent();
} }
~IndentScope() { printer_->Outdent(); } ~IndentScope() {
printer_->Outdent();
printer_->Outdent();
}
private: private:
grpc_generator::Printer* printer_; grpc_generator::Printer* printer_;
@ -92,8 +98,7 @@ void PrivateGenerator::PrintAllComments(StringVector comments,
// smarter and more sophisticated, but at the moment, if there is // smarter and more sophisticated, but at the moment, if there is
// no docstring to print, we simply emit "pass" to ensure validity // no docstring to print, we simply emit "pass" to ensure validity
// of the generated code. // of the generated code.
out->Print("# missing associated documentation comment in .proto file\n"); out->Print("\"\"\"Missing associated documentation comment in .proto file\"\"\"\n");
out->Print("pass\n");
return; return;
} }
out->Print("\"\"\""); out->Print("\"\"\"");
@ -653,6 +658,7 @@ bool PrivateGenerator::PrintServiceClass(
} }
} }
} }
// TODO(rbellevi): Add methods pertinent to the server side as well.
return true; return true;
} }

Loading…
Cancel
Save