clang-format codebase
diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc
index 43a04be..1116049 100644
--- a/src/compiler/cpp_generator.cc
+++ b/src/compiler/cpp_generator.cc
@@ -43,13 +43,11 @@
 namespace {
 
 bool NoStreaming(const google::protobuf::MethodDescriptor* method) {
-  return !method->client_streaming() &&
-         !method->server_streaming();
+  return !method->client_streaming() && !method->server_streaming();
 }
 
 bool ClientOnlyStreaming(const google::protobuf::MethodDescriptor* method) {
-  return method->client_streaming() &&
-         !method->server_streaming();
+  return method->client_streaming() && !method->server_streaming();
 }
 
 bool ServerOnlyStreaming(const google::protobuf::MethodDescriptor* method) {
@@ -57,8 +55,7 @@
 }
 
 bool BidiStreaming(const google::protobuf::MethodDescriptor* method) {
-  return method->client_streaming() &&
-         method->server_streaming();
+  return method->client_streaming() && method->server_streaming();
 }
 
 bool HasClientOnlyStreaming(const google::protobuf::FileDescriptor* file) {
@@ -132,8 +129,8 @@
 }
 
 void PrintHeaderClientMethod(google::protobuf::io::Printer* printer,
-                       const google::protobuf::MethodDescriptor* method,
-                       map<string, string>* vars) {
+                             const google::protobuf::MethodDescriptor* method,
+                             map<string, string>* vars) {
   (*vars)["Method"] = method->name();
   (*vars)["Request"] =
       grpc_cpp_generator::ClassName(method->input_type(), true);
@@ -204,8 +201,9 @@
   printer->Indent();
 
   // Client side
-  printer->Print("class Stub : public ::grpc::InternalStub {\n"
-                 " public:\n");
+  printer->Print(
+      "class Stub : public ::grpc::InternalStub {\n"
+      " public:\n");
   printer->Indent();
   for (int i = 0; i < service->method_count(); ++i) {
     PrintHeaderClientMethod(printer, service->method(i), vars);
@@ -219,8 +217,9 @@
   printer->Print("\n");
 
   // Server side
-  printer->Print("class Service {\n"
-                " public:\n");
+  printer->Print(
+      "class Service {\n"
+      " public:\n");
   printer->Indent();
   printer->Print("Service() : service_(nullptr) {}\n");
   printer->Print("virtual ~Service();\n");
@@ -229,8 +228,9 @@
   }
   printer->Print("::grpc::RpcService* service();\n");
   printer->Outdent();
-  printer->Print(" private:\n"
-                 "  ::grpc::RpcService* service_;\n");
+  printer->Print(
+      " private:\n"
+      "  ::grpc::RpcService* service_;\n");
   printer->Print("};\n");
 
   printer->Outdent();
@@ -251,8 +251,8 @@
 }
 
 void PrintSourceClientMethod(google::protobuf::io::Printer* printer,
-                       const google::protobuf::MethodDescriptor* method,
-                       map<string, string>* vars) {
+                             const google::protobuf::MethodDescriptor* method,
+                             map<string, string>* vars) {
   (*vars)["Method"] = method->name();
   (*vars)["Request"] =
       grpc_cpp_generator::ClassName(method->input_type(), true);
@@ -308,8 +308,8 @@
 }
 
 void PrintSourceServerMethod(google::protobuf::io::Printer* printer,
-                       const google::protobuf::MethodDescriptor* method,
-                       map<string, string>* vars) {
+                             const google::protobuf::MethodDescriptor* method,
+                             map<string, string>* vars) {
   (*vars)["Method"] = method->name();
   (*vars)["Request"] =
       grpc_cpp_generator::ClassName(method->input_type(), true);
@@ -362,12 +362,12 @@
                         map<string, string>* vars) {
   (*vars)["Service"] = service->name();
   printer->Print(*vars,
-      "$Service$::Stub* $Service$::NewStub("
-      "const std::shared_ptr<::grpc::ChannelInterface>& channel) {\n"
-      "  $Service$::Stub* stub = new $Service$::Stub();\n"
-      "  stub->set_channel(channel);\n"
-      "  return stub;\n"
-      "};\n\n");
+                 "$Service$::Stub* $Service$::NewStub("
+                 "const std::shared_ptr<::grpc::ChannelInterface>& channel) {\n"
+                 "  $Service$::Stub* stub = new $Service$::Stub();\n"
+                 "  stub->set_channel(channel);\n"
+                 "  return stub;\n"
+                 "};\n\n");
   for (int i = 0; i < service->method_count(); ++i) {
     PrintSourceClientMethod(printer, service->method(i), vars);
   }
@@ -380,11 +380,12 @@
     PrintSourceServerMethod(printer, service->method(i), vars);
   }
   printer->Print(*vars,
-      "::grpc::RpcService* $Service$::Service::service() {\n");
+                 "::grpc::RpcService* $Service$::Service::service() {\n");
   printer->Indent();
-  printer->Print("if (service_ != nullptr) {\n"
-                 "  return service_;\n"
-                 "}\n");
+  printer->Print(
+      "if (service_ != nullptr) {\n"
+      "  return service_;\n"
+      "}\n");
   printer->Print("service_ = new ::grpc::RpcService();\n");
   for (int i = 0; i < service->method_count(); ++i) {
     const google::protobuf::MethodDescriptor* method = service->method(i);
diff --git a/src/compiler/cpp_generator_helpers.h b/src/compiler/cpp_generator_helpers.h
index 8d8b03e..ba251fa 100644
--- a/src/compiler/cpp_generator_helpers.h
+++ b/src/compiler/cpp_generator_helpers.h
@@ -85,7 +85,8 @@
   return StringReplace(name, ".", "_");
 }
 
-inline string ClassName(const google::protobuf::Descriptor* descriptor, bool qualified) {
+inline string ClassName(const google::protobuf::Descriptor* descriptor,
+                        bool qualified) {
   // Find "outer", the descriptor of the top-level message in which
   // "descriptor" is embedded.
   const google::protobuf::Descriptor* outer = descriptor;
diff --git a/src/compiler/cpp_plugin.cc b/src/compiler/cpp_plugin.cc
index 7aa745a..17836b1 100644
--- a/src/compiler/cpp_plugin.cc
+++ b/src/compiler/cpp_plugin.cc
@@ -54,9 +54,10 @@
                         google::protobuf::compiler::GeneratorContext* context,
                         string* error) const {
     if (file->options().cc_generic_services()) {
-      *error = "cpp grpc proto compiler plugin does not work with generic "
-               "services. To generate cpp grpc APIs, please set \""
-               "cc_generic_service = false\".";
+      *error =
+          "cpp grpc proto compiler plugin does not work with generic "
+          "services. To generate cpp grpc APIs, please set \""
+          "cc_generic_service = false\".";
       return false;
     }
 
diff --git a/src/compiler/go_generator.cc b/src/compiler/go_generator.cc
index 8beae8d..3873eae 100644
--- a/src/compiler/go_generator.cc
+++ b/src/compiler/go_generator.cc
@@ -45,23 +45,19 @@
 namespace grpc_go_generator {
 
 bool NoStreaming(const google::protobuf::MethodDescriptor* method) {
-  return !method->client_streaming() &&
-         !method->server_streaming();
+  return !method->client_streaming() && !method->server_streaming();
 }
 
 bool ClientOnlyStreaming(const google::protobuf::MethodDescriptor* method) {
-  return method->client_streaming() &&
-         !method->server_streaming();
+  return method->client_streaming() && !method->server_streaming();
 }
 
 bool ServerOnlyStreaming(const google::protobuf::MethodDescriptor* method) {
-  return !method->client_streaming() &&
-         method->server_streaming();
+  return !method->client_streaming() && method->server_streaming();
 }
 
 bool BidiStreaming(const google::protobuf::MethodDescriptor* method) {
-  return method->client_streaming() &&
-         method->server_streaming();
+  return method->client_streaming() && method->server_streaming();
 }
 
 bool HasClientOnlyStreaming(const google::protobuf::FileDescriptor* file) {
@@ -91,20 +87,22 @@
   (*vars)["Response"] = method->output_type()->name();
   if (NoStreaming(method)) {
     printer->Print(*vars,
-        "\t$Method$(ctx context.Context, in *$Request$, opts ...rpc.CallOption) "
-        "(*$Response$, error)\n");
+                   "\t$Method$(ctx context.Context, in *$Request$, opts "
+                   "...rpc.CallOption) "
+                   "(*$Response$, error)\n");
   } else if (BidiStreaming(method)) {
     printer->Print(*vars,
-        "\t$Method$(ctx context.Context, opts ...rpc.CallOption) "
-        "($Service$_$Method$Client, error)\n");
+                   "\t$Method$(ctx context.Context, opts ...rpc.CallOption) "
+                   "($Service$_$Method$Client, error)\n");
   } else if (ServerOnlyStreaming(method)) {
-    printer->Print(*vars,
+    printer->Print(
+        *vars,
         "\t$Method$(ctx context.Context, m *$Request$, opts ...rpc.CallOption) "
         "($Service$_$Method$Client, error)\n");
   } else if (ClientOnlyStreaming(method)) {
     printer->Print(*vars,
-        "\t$Method$(ctx context.Context, opts ...rpc.CallOption) "
-        "($Service$_$Method$Client, error)\n");
+                   "\t$Method$(ctx context.Context, opts ...rpc.CallOption) "
+                   "($Service$_$Method$Client, error)\n");
   }
 }
 
@@ -116,11 +114,11 @@
   (*vars)["Response"] = method->output_type()->name();
 
   if (NoStreaming(method)) {
-    printer->Print(*vars,
+    printer->Print(
+        *vars,
         "func (c *$ServiceStruct$Client) $Method$(ctx context.Context, "
         "in *$Request$, opts ...rpc.CallOption) (*$Response$, error) {\n");
-    printer->Print(*vars,
-                   "\tout := new($Response$)\n");
+    printer->Print(*vars, "\tout := new($Response$)\n");
     printer->Print(*vars,
                    "\terr := rpc.Invoke(ctx, \"/$Package$$Service$/$Method$\", "
                    "in, out, c.cc, opts...)\n");
@@ -142,20 +140,22 @@
         "\treturn &$ServiceStruct$$Method$Client{stream}, nil\n"
         "}\n\n");
     printer->Print(*vars,
-        "type $Service$_$Method$Client interface {\n"
-        "\tSend(*$Request$) error\n"
-        "\tRecv() (*$Response$, error)\n"
-        "\trpc.ClientStream\n"
-        "}\n\n");
+                   "type $Service$_$Method$Client interface {\n"
+                   "\tSend(*$Request$) error\n"
+                   "\tRecv() (*$Response$, error)\n"
+                   "\trpc.ClientStream\n"
+                   "}\n\n");
     printer->Print(*vars,
-        "type $ServiceStruct$$Method$Client struct {\n"
-        "\trpc.ClientStream\n"
-        "}\n\n");
-    printer->Print(*vars,
+                   "type $ServiceStruct$$Method$Client struct {\n"
+                   "\trpc.ClientStream\n"
+                   "}\n\n");
+    printer->Print(
+        *vars,
         "func (x *$ServiceStruct$$Method$Client) Send(m *$Request$) error {\n"
         "\treturn x.ClientStream.SendProto(m)\n"
         "}\n\n");
-    printer->Print(*vars,
+    printer->Print(
+        *vars,
         "func (x *$ServiceStruct$$Method$Client) Recv() (*$Response$, error) "
         "{\n"
         "\tm := new($Response$)\n"
@@ -185,15 +185,16 @@
         "\treturn x, nil\n"
         "}\n\n");
     printer->Print(*vars,
-        "type $Service$_$Method$Client interface {\n"
-        "\tRecv() (*$Response$, error)\n"
-        "\trpc.ClientStream\n"
-        "}\n\n");
+                   "type $Service$_$Method$Client interface {\n"
+                   "\tRecv() (*$Response$, error)\n"
+                   "\trpc.ClientStream\n"
+                   "}\n\n");
     printer->Print(*vars,
-        "type $ServiceStruct$$Method$Client struct {\n"
-        "\trpc.ClientStream\n"
-        "}\n\n");
-    printer->Print(*vars,
+                   "type $ServiceStruct$$Method$Client struct {\n"
+                   "\trpc.ClientStream\n"
+                   "}\n\n");
+    printer->Print(
+        *vars,
         "func (x *$ServiceStruct$$Method$Client) Recv() (*$Response$, error) "
         "{\n"
         "\tm := new($Response$)\n"
@@ -215,20 +216,22 @@
         "\treturn &$ServiceStruct$$Method$Client{stream}, nil\n"
         "}\n\n");
     printer->Print(*vars,
-        "type $Service$_$Method$Client interface {\n"
-        "\tSend(*$Request$) error\n"
-        "\tCloseAndRecv() (*$Response$, error)\n"
-        "\trpc.ClientStream\n"
-        "}\n\n");
+                   "type $Service$_$Method$Client interface {\n"
+                   "\tSend(*$Request$) error\n"
+                   "\tCloseAndRecv() (*$Response$, error)\n"
+                   "\trpc.ClientStream\n"
+                   "}\n\n");
     printer->Print(*vars,
-        "type $ServiceStruct$$Method$Client struct {\n"
-        "\trpc.ClientStream\n"
-        "}\n\n");
-    printer->Print(*vars,
+                   "type $ServiceStruct$$Method$Client struct {\n"
+                   "\trpc.ClientStream\n"
+                   "}\n\n");
+    printer->Print(
+        *vars,
         "func (x *$ServiceStruct$$Method$Client) Send(m *$Request$) error {\n"
         "\treturn x.ClientStream.SendProto(m)\n"
         "}\n\n");
-    printer->Print(*vars,
+    printer->Print(
+        *vars,
         "func (x *$ServiceStruct$$Method$Client) CloseAndRecv() (*$Response$, "
         "error) {\n"
         "\tif err := x.ClientStream.CloseSend(); err != nil {\n"
@@ -264,7 +267,8 @@
                  "type $ServiceStruct$Client struct {\n"
                  "\tcc *rpc.ClientConn\n"
                  "}\n\n");
-  printer->Print(*vars,
+  printer->Print(
+      *vars,
       "func New$Service$Client(cc *rpc.ClientConn) $Service$Client {\n"
       "\treturn &$ServiceStruct$Client{cc}\n"
       "}\n\n");
@@ -280,17 +284,16 @@
   (*vars)["Request"] = method->input_type()->name();
   (*vars)["Response"] = method->output_type()->name();
   if (NoStreaming(method)) {
-    printer->Print(*vars,
+    printer->Print(
+        *vars,
         "\t$Method$(context.Context, *$Request$) (*$Response$, error)\n");
   } else if (BidiStreaming(method)) {
-    printer->Print(*vars,
-        "\t$Method$($Service$_$Method$Server) error\n");
+    printer->Print(*vars, "\t$Method$($Service$_$Method$Server) error\n");
   } else if (ServerOnlyStreaming(method)) {
     printer->Print(*vars,
-        "\t$Method$(*$Request$, $Service$_$Method$Server) error\n");
+                   "\t$Method$(*$Request$, $Service$_$Method$Server) error\n");
   } else if (ClientOnlyStreaming(method)) {
-    printer->Print(*vars,
-        "\t$Method$($Service$_$Method$Server) error\n");
+    printer->Print(*vars, "\t$Method$($Service$_$Method$Server) error\n");
   }
 }
 
@@ -301,11 +304,11 @@
   (*vars)["Request"] = method->input_type()->name();
   (*vars)["Response"] = method->output_type()->name();
   if (NoStreaming(method)) {
-    printer->Print(*vars,
+    printer->Print(
+        *vars,
         "func _$Service$_$Method$_Handler(srv interface{}, ctx context.Context,"
         " buf []byte) (proto.Message, error) {\n");
-    printer->Print(*vars,
-                   "\tin := new($Request$)\n");
+    printer->Print(*vars, "\tin := new($Request$)\n");
     printer->Print("\tif err := proto.Unmarshal(buf, in); err != nil {\n");
     printer->Print("\t\treturn nil, err\n");
     printer->Print("\t}\n");
@@ -317,27 +320,30 @@
     printer->Print("\treturn out, nil\n");
     printer->Print("}\n\n");
   } else if (BidiStreaming(method)) {
-    printer->Print(*vars,
+    printer->Print(
+        *vars,
         "func _$Service$_$Method$_Handler(srv interface{}, stream rpc.Stream) "
         "error {\n"
         "\treturn srv.($Service$Server).$Method$(&$ServiceStruct$$Method$Server"
         "{stream})\n"
         "}\n\n");
     printer->Print(*vars,
-        "type $Service$_$Method$Server interface {\n"
-        "\tSend(*$Response$) error\n"
-        "\tRecv() (*$Request$, error)\n"
-        "\trpc.Stream\n"
-        "}\n\n");
+                   "type $Service$_$Method$Server interface {\n"
+                   "\tSend(*$Response$) error\n"
+                   "\tRecv() (*$Request$, error)\n"
+                   "\trpc.Stream\n"
+                   "}\n\n");
     printer->Print(*vars,
-        "type $ServiceStruct$$Method$Server struct {\n"
-        "\trpc.Stream\n"
-        "}\n\n");
-    printer->Print(*vars,
+                   "type $ServiceStruct$$Method$Server struct {\n"
+                   "\trpc.Stream\n"
+                   "}\n\n");
+    printer->Print(
+        *vars,
         "func (x *$ServiceStruct$$Method$Server) Send(m *$Response$) error {\n"
         "\treturn x.Stream.SendProto(m)\n"
         "}\n\n");
-    printer->Print(*vars,
+    printer->Print(
+        *vars,
         "func (x *$ServiceStruct$$Method$Server) Recv() (*$Request$, error) "
         "{\n"
         "\tm := new($Request$)\n"
@@ -347,7 +353,8 @@
         "\treturn m, nil\n"
         "}\n\n");
   } else if (ServerOnlyStreaming(method)) {
-    printer->Print(*vars,
+    printer->Print(
+        *vars,
         "func _$Service$_$Method$_Handler(srv interface{}, stream rpc.Stream) "
         "error {\n"
         "\tm := new($Request$)\n"
@@ -358,36 +365,39 @@
         "&$ServiceStruct$$Method$Server{stream})\n"
         "}\n\n");
     printer->Print(*vars,
-        "type $Service$_$Method$Server interface {\n"
-        "\tSend(*$Response$) error\n"
-        "\trpc.Stream\n"
-        "}\n\n");
+                   "type $Service$_$Method$Server interface {\n"
+                   "\tSend(*$Response$) error\n"
+                   "\trpc.Stream\n"
+                   "}\n\n");
     printer->Print(*vars,
-        "type $ServiceStruct$$Method$Server struct {\n"
-        "\trpc.Stream\n"
-        "}\n\n");
-    printer->Print(*vars,
+                   "type $ServiceStruct$$Method$Server struct {\n"
+                   "\trpc.Stream\n"
+                   "}\n\n");
+    printer->Print(
+        *vars,
         "func (x *$ServiceStruct$$Method$Server) Send(m *$Response$) error {\n"
         "\treturn x.Stream.SendProto(m)\n"
         "}\n\n");
   } else if (ClientOnlyStreaming(method)) {
-    printer->Print(*vars,
+    printer->Print(
+        *vars,
         "func _$Service$_$Method$_Handler(srv interface{}, stream rpc.Stream) "
         "error {\n"
         "\treturn srv.($Service$Server).$Method$(&$ServiceStruct$$Method$Server"
         "{stream})\n"
         "}\n\n");
     printer->Print(*vars,
-        "type $Service$_$Method$Server interface {\n"
-        "\tSendAndClose(*$Response$) error\n"
-        "\tRecv() (*$Request$, error)\n"
-        "\trpc.Stream\n"
-        "}\n\n");
+                   "type $Service$_$Method$Server interface {\n"
+                   "\tSendAndClose(*$Response$) error\n"
+                   "\tRecv() (*$Request$, error)\n"
+                   "\trpc.Stream\n"
+                   "}\n\n");
     printer->Print(*vars,
-        "type $ServiceStruct$$Method$Server struct {\n"
-        "\trpc.Stream\n"
-        "}\n\n");
-    printer->Print(*vars,
+                   "type $ServiceStruct$$Method$Server struct {\n"
+                   "\trpc.Stream\n"
+                   "}\n\n");
+    printer->Print(
+        *vars,
         "func (x *$ServiceStruct$$Method$Server) SendAndClose(m *$Response$) "
         "error {\n"
         "\tif err := x.Stream.SendProto(m); err != nil {\n"
@@ -395,7 +405,8 @@
         "\t}\n"
         "\treturn nil\n"
         "}\n\n");
-    printer->Print(*vars,
+    printer->Print(
+        *vars,
         "func (x *$ServiceStruct$$Method$Server) Recv() (*$Request$, error) {\n"
         "\tm := new($Request$)\n"
         "\tif err := x.Stream.RecvProto(m); err != nil {\n"
@@ -411,22 +422,19 @@
                            map<string, string>* vars) {
   (*vars)["Method"] = method->name();
   printer->Print("\t\t{\n");
-  printer->Print(*vars,
-                 "\t\t\tMethodName:\t\"$Method$\",\n");
-  printer->Print(*vars,
-                 "\t\t\tHandler:\t_$Service$_$Method$_Handler,\n");
+  printer->Print(*vars, "\t\t\tMethodName:\t\"$Method$\",\n");
+  printer->Print(*vars, "\t\t\tHandler:\t_$Service$_$Method$_Handler,\n");
   printer->Print("\t\t},\n");
 }
 
-void PrintServerStreamingMethodDesc(google::protobuf::io::Printer* printer,
-                                    const google::protobuf::MethodDescriptor* method,
-                                    map<string, string>* vars) {
+void PrintServerStreamingMethodDesc(
+    google::protobuf::io::Printer* printer,
+    const google::protobuf::MethodDescriptor* method,
+    map<string, string>* vars) {
   (*vars)["Method"] = method->name();
   printer->Print("\t\t{\n");
-  printer->Print(*vars,
-                 "\t\t\tStreamName:\t\"$Method$\",\n");
-  printer->Print(*vars,
-                 "\t\t\tHandler:\t_$Service$_$Method$_Handler,\n");
+  printer->Print(*vars, "\t\t\tStreamName:\t\"$Method$\",\n");
+  printer->Print(*vars, "\t\t\tHandler:\t_$Service$_$Method$_Handler,\n");
   printer->Print("\t\t},\n");
 }
 
@@ -467,8 +475,9 @@
       PrintServerStreamingMethodDesc(printer, service->method(i), vars);
     }
   }
-  printer->Print("\t},\n"
-                 "}\n\n");
+  printer->Print(
+      "\t},\n"
+      "}\n\n");
 }
 
 std::string BadToUnderscore(std::string str) {
@@ -493,8 +502,9 @@
   printer.Print(vars, "package $PackageName$\n\n");
   printer.Print("import (\n");
   if (HasClientOnlyStreaming(file)) {
-    printer.Print("\t\"fmt\"\n"
-                  "\t\"io\"\n");
+    printer.Print(
+        "\t\"fmt\"\n"
+        "\t\"io\"\n");
   }
   printer.Print(
       "\t\"google/net/grpc/go/rpc\"\n"
diff --git a/src/compiler/go_plugin.cc b/src/compiler/go_plugin.cc
index f941840..c81612c 100644
--- a/src/compiler/go_plugin.cc
+++ b/src/compiler/go_plugin.cc
@@ -61,8 +61,8 @@
     string file_name;
     if (file->name().size() > 6 &&
         file->name().find_last_of(".proto") == file->name().size() - 1) {
-      file_name = file->name().substr(0, file->name().size() - 6) +
-          "_grpc.pb.go";
+      file_name =
+          file->name().substr(0, file->name().size() - 6) + "_grpc.pb.go";
     } else {
       *error = "Invalid proto file name. Proto file must end with .proto";
       return false;
diff --git a/src/compiler/ruby_generator.cc b/src/compiler/ruby_generator.cc
index 20485b4..fae8858 100644
--- a/src/compiler/ruby_generator.cc
+++ b/src/compiler/ruby_generator.cc
@@ -67,9 +67,8 @@
     output_type = "stream(" + output_type + ")";
   }
   map<string, string> method_vars = ListToDict({
-      "mth.name", method->name(),
-      "input.type", input_type,
-      "output.type", output_type,
+      "mth.name", method->name(), "input.type", input_type, "output.type",
+      output_type,
   });
   out->Print(method_vars, "rpc :$mth.name$, $input.type$, $output.type$\n");
 }
@@ -105,8 +104,7 @@
   out->Print("self.marshal_class_method = :encode\n");
   out->Print("self.unmarshal_class_method = :decode\n");
   map<string, string> pkg_vars = ListToDict({
-      "service.name", service->name(),
-      "pkg.name", package,
+      "service.name", service->name(), "pkg.name", package,
   });
   out->Print(pkg_vars, "self.service_name = '$pkg.name$.$service.name$'\n");
   out->Print("\n");
@@ -139,9 +137,8 @@
 
   // Write out a file header.
   map<string, string> header_comment_vars = ListToDict({
-        "file.name", file->name(),
-        "file.package", file->package(),
-      });
+      "file.name", file->name(), "file.package", file->package(),
+  });
   out.Print("# Generated by the protocol buffer compiler.  DO NOT EDIT!\n");
   out.Print(header_comment_vars,
             "# Source: $file.name$ for package '$file.package$'\n");
diff --git a/src/compiler/ruby_generator_helpers-inl.h b/src/compiler/ruby_generator_helpers-inl.h
index 67a5eed..8263e35 100644
--- a/src/compiler/ruby_generator_helpers-inl.h
+++ b/src/compiler/ruby_generator_helpers-inl.h
@@ -47,8 +47,9 @@
   static const unsigned proto_suffix_length = 6;  // length of ".proto"
   if (file->name().size() > proto_suffix_length &&
       file->name().find_last_of(".proto") == file->name().size() - 1) {
-    *file_name_or_error = file->name().substr(
-        0, file->name().size() - proto_suffix_length) + "_services.rb";
+    *file_name_or_error =
+        file->name().substr(0, file->name().size() - proto_suffix_length) +
+        "_services.rb";
     return true;
   } else {
     *file_name_or_error = "Invalid proto file name:  must end with .proto";
@@ -56,7 +57,8 @@
   }
 }
 
-inline string MessagesRequireName(const google::protobuf::FileDescriptor* file) {
+inline string MessagesRequireName(
+    const google::protobuf::FileDescriptor* file) {
   return Replace(file->name(), ".proto", "");
 }
 
diff --git a/src/compiler/ruby_generator_map-inl.h b/src/compiler/ruby_generator_map-inl.h
index ea50506..fa86fbb 100644
--- a/src/compiler/ruby_generator_map-inl.h
+++ b/src/compiler/ruby_generator_map-inl.h
@@ -40,7 +40,6 @@
 #include <string>
 #include <vector>
 
-
 using std::initializer_list;
 using std::map;
 using std::vector;
@@ -51,11 +50,12 @@
 // into a map of key* to value*. Is merely a readability helper for later code.
 inline map<string, string> ListToDict(const initializer_list<string>& values) {
   if (values.size() % 2 != 0) {
-    // MOE: insert     std::cerr << "Not every 'key' has a value in `values`." << std::endl;
+    // MOE: insert     std::cerr << "Not every 'key' has a value in `values`."
+    // << std::endl;
   }
   map<string, string> value_map;
   auto value_iter = values.begin();
-  for (unsigned i = 0; i < values.size()/2; ++i) {
+  for (unsigned i = 0; i < values.size() / 2; ++i) {
     string key = *value_iter;
     ++value_iter;
     string value = *value_iter;
diff --git a/src/compiler/ruby_generator_string-inl.h b/src/compiler/ruby_generator_string-inl.h
index 85a76fa..44e17a2 100644
--- a/src/compiler/ruby_generator_string-inl.h
+++ b/src/compiler/ruby_generator_string-inl.h
@@ -45,7 +45,7 @@
 namespace grpc_ruby_generator {
 
 // Split splits a string using char into elems.
-inline vector<string> &Split(const string &s, char delim,
+inline vector<string>& Split(const string& s, char delim,
                              vector<string>* elems) {
   stringstream ss(s);
   string item;
@@ -56,7 +56,7 @@
 }
 
 // Split splits a string using char, returning the result in a vector.
-inline vector<string> Split(const string &s, char delim) {
+inline vector<string> Split(const string& s, char delim) {
   vector<string> elems;
   Split(s, delim, &elems);
   return elems;
@@ -106,7 +106,7 @@
 inline string RubyTypeOf(const string& a_type, const string& package) {
   string res(a_type);
   ReplacePrefix(&res, package, "");  // remove the leading package if present
-  ReplacePrefix(&res, ".", "");  // remove the leading . (no package)
+  ReplacePrefix(&res, ".", "");      // remove the leading . (no package)
   if (res.find('.') == string::npos) {
     return res;
   } else {