Skip to content

Tracking: tools/check style-check roadmap #2693

Description

@itsgrimetime

Following #2670 (tools/check with jobj-flags + assert-macros), collecting
proposed checks and tooling so we can agree on shape before implementing each.
Comments on scope/shape welcome before any PR.

Tooling

  • --fix mode — apply fixes locally (not CI). jobj-flags is byte-safe;
    assert-macros is best-effort (dev builds + verifies, @todos stragglers).
    Dry-run diff by default. (suggested by @ribbanya)
  • Generalize the flag check to config-driven (function name, parameter index) → flag set, resolving raw literals (incl. composite masks, via bit-shift
    decomposition like tools/flags) to the named flags. Subsumes jobj-flags.

Proposed checks

  • Arbitrary JObj flags — any raw literal in HSD_JObj*Flags* resolvable to
    named JOBJ_* flags (generalizes the current 0x10JOBJ_HIDDEN check).
  • Fighter motion-state flags in Fighter_ChangeMotionState calls — raw
    literals → named flags.
  • Extern data that should be literal (floats, strings, …). ⚠️ needs a rule
    to distinguish de-inlining anti-patterns from legit cross-TU pool-sharing
    externs (e.g. zako matches ftcoattack100 #2666 extern f32 ftCo_804D90D0), or it false-positives.
  • Named identifier where a literal belongs (the use-site side of the above);
    same contextual caveat.

References

  • tools/flags — decomposes a literal into its bit-shifted flag set.

Open questions for maintainers

  • Which checks should be blocking CI vs advisory?
  • Preferred config format for (function, param) → flagset?
  • For the extern/literal pair: how do we reliably separate anti-pattern from
    intentional cross-TU externs?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions