ziglint Changelog View on GitHub

Z032: Acronyms should use standard casing

Acronyms and initialisms in identifiers should follow standard Zig casing rules, not be written in all-caps. Even two-letter acronyms are subject to these conventions.

Examples

Bad

// expect: Z032
const XMLParser = struct {};
// expect: Z032
const HTTPSConnection = struct {};
// expect: Z032
fn parseXML() void {}
// expect: Z032
const IOError = struct {};

Good

const XmlParser = struct {};
const HttpsConnection = struct {};
fn parseXml() void {}
const IoError = struct {};

Single uppercase letters followed by lowercase are fine:

fn readU32() u32 { return 0; }

Rationale

From the Zig Style Guide:

Acronyms, initialisms, proper nouns, or any other word that has capitalization rules in written English are subject to naming conventions just like any other word. Even acronyms that are only 2 letters long are subject to these conventions.

This means:

The standard library follows this convention (e.g., std.json, std.http, std.io).

See Also