[
  {
    "id": "parse_error",
    "severity": "violation",
    "rules": [],
    "summary": "Zig cannot parse this file, so no check ran."
  },
  {
    "id": "runtime_safety_off",
    "severity": "violation",
    "rules": [
      "dir-4-1"
    ],
    "summary": "@setRuntimeSafety(false) deletes the checks in every build mode. Guard the input or return an error."
  },
  {
    "id": "untyped_literal_const",
    "severity": "violation",
    "rules": [
      "dir-4-6",
      "rule-8-1"
    ],
    "summary": "A container-level number has no width. Write the type on the declaration."
  },
  {
    "id": "extern_usize_field",
    "severity": "violation",
    "rules": [
      "dir-4-6"
    ],
    "summary": "An extern struct field crosses a C header. Name the width: u32 or u64, not usize."
  },
  {
    "id": "global_allocator",
    "severity": "violation",
    "rules": [
      "dir-4-12",
      "rule-21-3"
    ],
    "summary": "A global allocator outside main hides the owner. Take a std.mem.Allocator parameter."
  },
  {
    "id": "anytype_unused",
    "severity": "violation",
    "rules": [
      "rule-8-2"
    ],
    "summary": "This anytype parameter is never used, so no type is rejected. Give it a concrete type."
  },
  {
    "id": "anyerror_return",
    "severity": "violation",
    "rules": [
      "dir-4-1"
    ],
    "summary": "anyerror is not a return type. Infer the set with !T or name it."
  },
  {
    "id": "catch_empty",
    "severity": "violation",
    "rules": [
      "dir-4-1"
    ],
    "summary": "catch {} discards the error, and so does a handler that only discards its capture. Propagate it with try or handle each error."
  },
  {
    "id": "catch_unreachable",
    "severity": "violation",
    "rules": [
      "dir-4-1"
    ],
    "summary": "catch unreachable is illegal behavior when the error happens. Propagate it with try."
  },
  {
    "id": "pub_wrapper",
    "severity": "violation",
    "rules": [
      "rule-8-8"
    ],
    "summary": "This pub function only forwards to a file-local function, which publishes it again."
  },
  {
    "id": "mutable_param_read_only",
    "severity": "violation",
    "rules": [
      "rule-8-13"
    ],
    "summary": "The function only reads this parameter. Make it []const T or *const T."
  },
  {
    "id": "undefined_then_branch",
    "severity": "review",
    "rules": [
      "rule-9-1"
    ],
    "summary": "The first write after = undefined is inside a branch. A path that skips it reads undefined."
  },
  {
    "id": "field_by_field_init",
    "severity": "review",
    "rules": [
      "rule-9-2"
    ],
    "summary": "A struct starts as undefined and is written field by field. Write every field in one literal."
  },
  {
    "id": "truncate_param",
    "severity": "review",
    "rules": [
      "rule-10-3"
    ],
    "summary": "@truncate on a parameter drops the high bits of a value from outside. Use std.math.cast unless the low bits are the result."
  },
  {
    "id": "bitcast_arith",
    "severity": "violation",
    "rules": [
      "rule-10-4"
    ],
    "summary": "@bitCast changes the signedness and the result goes straight into arithmetic. Convert with std.math.cast."
  },
  {
    "id": "enum_int_arith",
    "severity": "violation",
    "rules": [
      "rule-10-5"
    ],
    "summary": "Arithmetic on an enum's integer invents a tag the enum may not have."
  },
  {
    "id": "narrow_sum_widened",
    "severity": "violation",
    "rules": [
      "rule-10-6"
    ],
    "summary": "The operation runs at the narrow operand width and only the result is widened. Use std.math.add(Wide, a, b)."
  },
  {
    "id": "narrow_operand",
    "severity": "violation",
    "rules": [
      "rule-10-7"
    ],
    "summary": "A narrow inner operation feeds a wider one. Finish the inner operation at the wider width."
  },
  {
    "id": "widening_cast_of_sum",
    "severity": "violation",
    "rules": [
      "rule-10-8"
    ],
    "summary": "The cast widens the result after a narrow operation. Widen the operands first."
  },
  {
    "id": "mixed_precedence",
    "severity": "violation",
    "rules": [
      "rule-12-1"
    ],
    "summary": "Operators of different kinds share an expression without parentheses."
  },
  {
    "id": "unbounded_loop",
    "severity": "review",
    "rules": [
      "rule-15-1"
    ],
    "summary": "while (true) has no bound. A retry loop counts and returns an error at the bound."
  },
  {
    "id": "empty_else_prong",
    "severity": "violation",
    "rules": [
      "rule-16-4"
    ],
    "summary": "else => {} swallows every value the prongs do not list. Return an error or handle it."
  },
  {
    "id": "recursion",
    "severity": "violation",
    "rules": [
      "rule-17-2"
    ],
    "summary": "This function reaches itself through calls in this file. Use a loop and an explicit stack."
  },
  {
    "id": "global_c_alloc",
    "severity": "violation",
    "rules": [
      "rule-21-3"
    ],
    "summary": "malloc, calloc, realloc, and free are not the allocator. Take a std.mem.Allocator parameter."
  },
  {
    "id": "deprecated_api",
    "severity": "violation",
    "rules": [
      "rule-1-5"
    ],
    "summary": "The Zig 0.17 std marks this deprecated. Use the replacement in parentheses."
  },
  {
    "id": "ptrcast_span",
    "severity": "violation",
    "rules": [
      "rule-21-17"
    ],
    "summary": "std.mem.span over a cast pointer walks until a zero that may be outside the object."
  },
  {
    "id": "index_at_len",
    "severity": "review",
    "rules": [
      "rule-21-17"
    ],
    "summary": "x[x.len] is one past the end, unless x is a sentinel slice or array."
  },
  {
    "id": "memcpy_unchecked_len",
    "severity": "violation",
    "rules": [
      "rule-21-18"
    ],
    "summary": "The copy length is a parameter that is never compared with either length."
  },
  {
    "id": "try_before_release",
    "severity": "violation",
    "rules": [
      "rule-22-1"
    ],
    "summary": "A later try or return leaves before this resource has a defer or errdefer."
  },
  {
    "id": "free_not_owned",
    "severity": "violation",
    "rules": [
      "rule-22-2"
    ],
    "summary": "free takes the exact slice alloc returned, not an address or a sub-slice."
  },
  {
    "id": "same_path_twice",
    "severity": "review",
    "rules": [
      "rule-22-3"
    ],
    "summary": "The same path is opened twice in one function. Open one handle that can do both."
  },
  {
    "id": "raw_handle",
    "severity": "violation",
    "rules": [
      "rule-22-5"
    ],
    "summary": "file.handle passed to std.posix bypasses the std.Io implementation that owns it."
  },
  {
    "id": "use_after_close",
    "severity": "violation",
    "rules": [
      "rule-22-6"
    ],
    "summary": "The handle is used after close."
  },
  {
    "id": "errno_clear_after_call",
    "severity": "violation",
    "rules": [
      "rule-22-8"
    ],
    "summary": "errno is cleared after the libc call. Clear it on the line before."
  },
  {
    "id": "errno_without_failure",
    "severity": "violation",
    "rules": [
      "rule-22-9"
    ],
    "summary": "errno is read without a -1 return in front of it."
  },
  {
    "id": "errno_after_call",
    "severity": "violation",
    "rules": [
      "rule-22-10"
    ],
    "summary": "A call runs between the -1 test and the errno read, and it can replace errno."
  },
  {
    "id": "assert_on_input",
    "severity": "violation",
    "rules": [
      "dir-4-1"
    ],
    "summary": "std.debug.assert on a C caller's value is an assumption in ReleaseFast. Check it and return an error."
  },
  {
    "id": "unchecked_divisor",
    "severity": "violation",
    "rules": [
      "dir-4-1"
    ],
    "summary": "The divisor is a parameter that is never compared in this function. Zero is illegal behavior in ReleaseFast."
  },
  {
    "id": "unchecked_intcast",
    "severity": "violation",
    "rules": [
      "rule-10-3",
      "rule-10-1"
    ],
    "summary": "@intCast of a parameter that is never compared in this function. Use std.math.cast or check the range first."
  },
  {
    "id": "unchecked_enum",
    "severity": "violation",
    "rules": [
      "rule-10-5"
    ],
    "summary": "@enumFromInt of a parameter that is never compared in this function. Use std.enums.fromInt."
  },
  {
    "id": "bare_union",
    "severity": "violation",
    "rules": [
      "rule-19-2"
    ],
    "summary": "A bare union does not know its stored field. Use union(enum), or extern or packed union for a C or register layout."
  },
  {
    "id": "write_read_only",
    "severity": "violation",
    "rules": [
      "rule-22-4"
    ],
    "summary": "This handle was opened read-only (the openFile default) and is written. Open it .read_write or .write_only."
  },
  {
    "id": "enum_else",
    "severity": "review",
    "rules": [
      "rule-16-4"
    ],
    "summary": "The prongs name enum tags and else takes the rest without an error. On an exhaustive enum, list every tag so a new one is a compile error."
  },
  {
    "id": "terminate_outside_main",
    "severity": "violation",
    "rules": [
      "rule-21-8"
    ],
    "summary": "Only main ends the process. Return an error instead of @panic, std.debug.panic, or std.process.exit."
  },
  {
    "id": "orelse_unreachable",
    "severity": "violation",
    "rules": [
      "dir-4-1"
    ],
    "summary": "orelse unreachable is illegal behavior when the value is null. Return an error."
  },
  {
    "id": "unwrap_assumed",
    "severity": "review",
    "rules": [
      "dir-4-1"
    ],
    "summary": ".? on a call result assumes it is not null. Use orelse with an error unless a local check proves it."
  },
  {
    "id": "assume_capacity",
    "severity": "review",
    "rules": [
      "dir-4-1"
    ],
    "summary": "An AssumeCapacity call with no ensure...Capacity or initCapacity on this list earlier in the function."
  },
  {
    "id": "unlimited_limit",
    "severity": "violation",
    "rules": [
      "dir-4-14"
    ],
    "summary": "An unlimited read lets the file or the peer choose the allocation. Pass .limited(max)."
  },
  {
    "id": "float_to_int",
    "severity": "violation",
    "rules": [
      "rule-10-3"
    ],
    "summary": "A float becomes an integer with no range check in this function. NaN, infinity, and large values are illegal behavior."
  },
  {
    "id": "stack_escape",
    "severity": "violation",
    "rules": [
      "rule-18-6"
    ],
    "summary": "This returns a pointer into a local that dies when the function returns."
  },
  {
    "id": "posix_assumes_errno",
    "severity": "violation",
    "rules": [
      "dir-4-1"
    ],
    "summary": "This std.posix wrapper maps an errno to unreachable. Call std.posix.system and switch on std.posix.errno."
  },
  {
    "id": "thread_in_loop",
    "severity": "violation",
    "rules": [
      "dir-5-3"
    ],
    "summary": "A thread is spawned inside a while loop, so the count follows the input. Spawn a fixed set of workers at start-up."
  },
  {
    "id": "thread_outside_main",
    "severity": "review",
    "rules": [
      "dir-5-3"
    ],
    "summary": "A thread is spawned outside main. Confirm it runs once at start-up for a fixed count, not per request."
  },
  {
    "id": "thread_detached",
    "severity": "violation",
    "rules": [
      "dir-5-3"
    ],
    "summary": "A detached thread has no end anyone waits for. Join every thread."
  },
  {
    "id": "io_outside_main",
    "severity": "violation",
    "rules": [
      "dir-4-12"
    ],
    "summary": "std.Io.Threaded is built outside main; it installs process-wide signal handlers. Take io: std.Io as a parameter."
  },
  {
    "id": "handwritten_extern",
    "severity": "review",
    "rules": [
      "rule-8-4"
    ],
    "summary": "A handwritten extern fn can drift from the C header. Take it from the translated header unless no header exposes it."
  },
  {
    "id": "sentinel_return",
    "severity": "review",
    "rules": [
      "dir-4-7"
    ],
    "summary": "An in-band value reports failure or not-found. Return ?T or an error unless a C ABI requires it."
  },
  {
    "id": "build_unsafe_mode",
    "severity": "violation",
    "rules": [
      "dir-4-1"
    ],
    "summary": "The build hard-codes a mode without safety checks. Use b.standardOptimizeOption and keep sanitize_c on."
  },
  {
    "id": "ptrcast_reinterpret",
    "severity": "review",
    "rules": [
      "rule-11-3"
    ],
    "summary": "@ptrCast between pointers to two value types. Reinterpret a value with @bitCast."
  },
  {
    "id": "unreachable_file",
    "severity": "violation",
    "rules": [
      "rule-2-1"
    ],
    "summary": "The root does not reach this file through @import, so the compiler never analyzes it."
  }
]
