Skip to content

chore(lint): fix all ziglint violations#50

Merged
vmvarela merged 1 commit intomasterfrom
chore/fix-ziglint-violations
Mar 14, 2026
Merged

chore(lint): fix all ziglint violations#50
vmvarela merged 1 commit intomasterfrom
chore/fix-ziglint-violations

Conversation

@vmvarela
Copy link
Owner

Summary

  • Fix all 31 `ziglint` violations across `src/main.zig`, `src/csv.zig`, and `build.zig`
  • Add `.ziglint.zon` configuration file to the project

Changes by rule

Rule Description Fix
Z026 Empty `catch {}` suppresses errors Replaced with `catch
Z023 `Allocator` / `comptime` params not first Moved to first position in 8 functions
Z032 `SQLITE_STATIC` acronym casing Renamed to `sqlite_static`
Z006 `INFERENCE_BUFFER_SIZE` not snake_case Renamed to `inference_buffer_size`
Z004 `T{}` init syntax Replaced with `.init` (also fixes Z011 `GeneralPurposeAllocator` deprecation → `DebugAllocator`)
Z024 Lines > 120 chars Shortened decorator comments; broke long `fatal()` calls into multi-line; split `b.option()` calls

A `.ziglint.zon` is added with `max_length = 200` to accommodate shell multiline strings in `build.zig` that cannot be wrapped.

Verification

```
ziglint src build.zig # 0 violations
zig build # OK
zig build unit-test # OK
```

- Z026: replace empty catch {} with explicit error logging via std.log.err
- Z023: move Allocator and comptime parameters to first position in all
  affected functions (inferTypes, parseHeader, createTable, prepareInsert,
  execQuery, fatal, csvReader, csvReaderWithDelimiter)
- Z032: rename SQLITE_STATIC → sqlite_static (acronym casing)
- Z006: rename INFERENCE_BUFFER_SIZE → inference_buffer_size (snake_case)
- Z004: use .init syntax for DebugAllocator instead of T{} (also fixes Z011
  deprecation of GeneralPurposeAllocator)
- Z024: shorten decorator comment lines; break long fatal() call-sites into
  multi-line; split b.option() calls in build.zig; add .ziglint.zon with
  max_length=200 to accommodate shell multiline strings in build.zig
@github-actions github-actions bot added type:feature New functionality type:chore Maintenance, refactoring, tooling labels Mar 14, 2026
@vmvarela vmvarela merged commit fab483b into master Mar 14, 2026
6 checks passed
@vmvarela vmvarela deleted the chore/fix-ziglint-violations branch March 14, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:chore Maintenance, refactoring, tooling type:feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant