Niceify formatting in webgpu_cpp

Since now there's a copy (slightly hand-modified) saved into
Emscripten: https://github.com/emscripten-core/emscripten/pull/11737

Bug: None
Change-Id: I2677400f9e69a7fcd71f89bdaa04c642be357151
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/26005
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
diff --git a/generator/templates/webgpu_cpp.cpp b/generator/templates/webgpu_cpp.cpp
index 7d22f64..be17a5d 100644
--- a/generator/templates/webgpu_cpp.cpp
+++ b/generator/templates/webgpu_cpp.cpp
@@ -11,37 +11,39 @@
 //* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 //* See the License for the specific language governing permissions and
 //* limitations under the License.
-
 #include "dawn/webgpu_cpp.h"
 
 namespace wgpu {
-
     {% for type in by_category["enum"] %}
         {% set CppType = as_cppType(type.name) %}
         {% set CType = as_cType(type.name) %}
 
+        // {{CppType}}
+
         static_assert(sizeof({{CppType}}) == sizeof({{CType}}), "sizeof mismatch for {{CppType}}");
         static_assert(alignof({{CppType}}) == alignof({{CType}}), "alignof mismatch for {{CppType}}");
 
         {% for value in type.values %}
             static_assert(static_cast<uint32_t>({{CppType}}::{{as_cppEnum(value.name)}}) == {{as_cEnum(type.name, value.name)}}, "value mismatch for {{CppType}}::{{as_cppEnum(value.name)}}");
         {% endfor %}
-
-    {% endfor %}
+    {% endfor -%}
 
     {% for type in by_category["bitmask"] %}
         {% set CppType = as_cppType(type.name) %}
         {% set CType = as_cType(type.name) + "Flags" %}
 
+        // {{CppType}}
+
         static_assert(sizeof({{CppType}}) == sizeof({{CType}}), "sizeof mismatch for {{CppType}}");
         static_assert(alignof({{CppType}}) == alignof({{CType}}), "alignof mismatch for {{CppType}}");
 
         {% for value in type.values %}
             static_assert(static_cast<uint32_t>({{CppType}}::{{as_cppEnum(value.name)}}) == {{as_cEnum(type.name, value.name)}}, "value mismatch for {{CppType}}::{{as_cppEnum(value.name)}}");
         {% endfor %}
-
     {% endfor %}
 
+    // ChainedStruct
+
     static_assert(sizeof(ChainedStruct) == sizeof(WGPUChainedStruct),
             "sizeof mismatch for ChainedStruct");
     static_assert(alignof(ChainedStruct) == alignof(WGPUChainedStruct),
@@ -50,11 +52,12 @@
             "offsetof mismatch for ChainedStruct::nextInChain");
     static_assert(offsetof(ChainedStruct, sType) == offsetof(WGPUChainedStruct, sType),
             "offsetof mismatch for ChainedStruct::sType");
-
     {% for type in by_category["structure"] %}
         {% set CppType = as_cppType(type.name) %}
         {% set CType = as_cType(type.name) %}
 
+        // {{CppType}}
+
         static_assert(sizeof({{CppType}}) == sizeof({{CType}}), "sizeof mismatch for {{CppType}}");
         static_assert(alignof({{CppType}}) == alignof({{CType}}), "alignof mismatch for {{CppType}}");
 
@@ -67,17 +70,18 @@
             static_assert(offsetof({{CppType}}, {{memberName}}) == offsetof({{CType}}, {{memberName}}),
                     "offsetof mismatch for {{CppType}}::{{memberName}}");
         {% endfor %}
-
-    {% endfor %}
+    {% endfor -%}
 
     {% for type in by_category["object"] %}
         {% set CppType = as_cppType(type.name) %}
         {% set CType = as_cType(type.name) %}
 
+        // {{CppType}}
+
         static_assert(sizeof({{CppType}}) == sizeof({{CType}}), "sizeof mismatch for {{CppType}}");
         static_assert(alignof({{CppType}}) == alignof({{CType}}), "alignof mismatch for {{CppType}}");
 
-        {% macro render_cpp_method_declaration(type, method) %}
+        {% macro render_cpp_method_declaration(type, method) -%}
             {% set CppType = as_cppType(type.name) %}
             {{as_cppType(method.return_type.name)}} {{CppType}}::{{method.name.CamelCase()}}(
                 {%- for arg in method.arguments -%}
@@ -89,9 +93,9 @@
                     {%- endif -%}
                 {%- endfor -%}
             ) const
-        {%- endmacro %}
+        {%- endmacro -%}
 
-        {% macro render_cpp_to_c_method_call(type, method) -%}
+        {%- macro render_cpp_to_c_method_call(type, method) -%}
             {{as_cMethod(type.name, method.name)}}(Get()
                 {%- for arg in method.arguments -%},{{" "}}
                     {%- if arg.annotation == "value" -%}
@@ -109,9 +113,9 @@
                     {%- endif -%}
                 {%- endfor -%}
             )
-        {%- endmacro %}
+        {%- endmacro -%}
 
-        {% for method in type.methods %}
+        {% for method in type.methods -%}
             {{render_cpp_method_declaration(type, method)}} {
                 {% if method.return_type.name.concatcase() == "void" %}
                     {{render_cpp_to_c_method_call(type, method)}};
@@ -131,9 +135,10 @@
                 {{as_cMethod(type.name, Name("release"))}}(handle);
             }
         }
-
     {% endfor %}
 
+    // Instance
+
     Instance CreateInstance(const InstanceDescriptor* descriptor) {
         const WGPUInstanceDescriptor* cDescriptor =
             reinterpret_cast<const WGPUInstanceDescriptor*>(descriptor);
diff --git a/generator/templates/webgpu_cpp.h b/generator/templates/webgpu_cpp.h
index 3dde1e8..c523a17 100644
--- a/generator/templates/webgpu_cpp.h
+++ b/generator/templates/webgpu_cpp.h
@@ -11,7 +11,6 @@
 //* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 //* See the License for the specific language governing permissions and
 //* limitations under the License.
-
 #ifndef WEBGPU_CPP_H_
 #define WEBGPU_CPP_H_