Skip to content
naming-convention · Lint · warning

Naming convention violation

Functions/variables use `snake_case`; structs/enums/traits/effects use `PascalCase`.

Why this fires

Zolo enforces conventional casing so that names communicate their kind at a glance. The compiler classifies identifiers in two buckets:

Kind Convention Example
Functions, methods, variables, parameters snake_case parse_input
Structs, enums, traits, effects PascalCase HttpRequest
fn ParseInput(s: str) { }   // warning: function name should be snake_case
struct http_request { }     // warning: struct name should be PascalCase

Fix it

Rename the binding to follow the convention. Editor refactors handle most cases:

fn parse_input(s: str) { }
struct HttpRequest { }

Names with acronyms

Treat acronyms as words — HttpRequest, not HTTPRequest; parse_html, not parse_HTML. This keeps boundary detection unambiguous for tooling and humans alike.

When the lint is wrong

If you are interfacing with an external system whose names you must match exactly (FFI, a JSON schema you can't control), suppress the lint locally rather than renaming:

@diagnostic(off, "naming-convention")
extern fn JNI_OnLoad(vm: *VM) -> int

For most code, fix the name.

enespt-br