Detect type functions and require PascalCase, require camelCase for the rest

This commit is contained in:
Alexandros Naskos
2020-05-08 18:01:34 +03:00
parent ffcdb886d9
commit 29b0045bc7
2 changed files with 44 additions and 22 deletions

View File

@@ -87,3 +87,7 @@ pub fn getVariableSignature(tree: *std.zig.ast.Tree, var_decl: *std.zig.ast.Node
pub fn isCamelCase(name: []const u8) bool {
return !std.ascii.isUpper(name[0]) and std.mem.indexOf(u8, name, "_") == null;
}
pub fn isPascalCase(name: []const u8) bool {
return std.ascii.isUpper(name[0]) and std.mem.indexOf(u8, name, "_") == null;
}