nektro / ziglint

A linting suite for Zig
MIT License
87 stars 3 forks source link

avoid `@Type(.EnumLiteral)` when possible #32

Open nektro opened 6 months ago

nektro commented 6 months ago

its not something that should never be used, but using a discrete enum almost always makes code more readable and produces better error messages. FieldEnum and DeclEnum from std.meta go a long way in this regard. tactful in-line parameter enums can also be useful (eg foo: enum { fast, slow })

this also goes hand-in-hand with the general advice of preferring enum arguments over booleans