Update Style Guide to suggest TitleCase for Type aliases

This commit is contained in:
Zirunis 2025-11-09 04:35:01 +01:00 committed by GitHub
parent b31a03f134
commit 07f50c0351
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7105,7 +7105,7 @@ coding style.
</p> </p>
<ul> <ul>
<li> <li>
If {#syntax#}x{#endsyntax#} is a {#syntax#}type{#endsyntax#} If {#syntax#}x{#endsyntax#} is a {#syntax#}type{#endsyntax#} (or {#syntax#}type{#endsyntax#} alias)
then {#syntax#}x{#endsyntax#} should be {#syntax#}TitleCase{#endsyntax#}, unless it then {#syntax#}x{#endsyntax#} should be {#syntax#}TitleCase{#endsyntax#}, unless it
is a {#syntax#}struct{#endsyntax#} with 0 fields and is never meant to be instantiated, is a {#syntax#}struct{#endsyntax#} with 0 fields and is never meant to be instantiated,
in which case it is considered to be a "namespace" and uses {#syntax#}snake_case{#endsyntax#}. in which case it is considered to be a "namespace" and uses {#syntax#}snake_case{#endsyntax#}.
@ -7147,8 +7147,8 @@ const namespace_name = @import("dir_name/file_name.zig");
const TypeName = @import("dir_name/TypeName.zig"); const TypeName = @import("dir_name/TypeName.zig");
var global_var: i32 = undefined; var global_var: i32 = undefined;
const const_name = 42; const const_name = 42;
const primitive_type_alias = f32; const PrimitiveTypeAlias = f32;
const string_alias = []u8; const StringAlias = []u8;
const StructName = struct { const StructName = struct {
field: i32, field: i32,