ziglint Changelog View on GitHub

Z001: Function names should be camelCase

Zig convention is to use camelCase for function names. This distinguishes functions from types (which use PascalCase) and variables (which use snake_case).

Functions that return types are an exception - see Z005 for type function naming.

Examples

Bad

// expect: Z001
fn MyFunction() void {}
// expect: Z001
fn my_function() void {}

Good

fn myFunction() void {}
fn myHttpHandler() void {}

Leading underscores pass this rule but are discouraged by Z031:

// expect: Z031
fn _internalHelper() void {}

Rationale

Consistent naming helps readers quickly identify what an identifier represents:

This matches the style used in the Zig standard library.