Skip to content

chore: migrate src/ off mod.rs to modern module-file style #73

Description

@iheitlager

Description

src/ still uses the legacy foo/mod.rs module layout in 6 places
(vfs, record, parser, schema, btree, pager) — ff mod.rs | wc -l reports 7,
but the 7th (tests/spike/.../lemon-rs) is vendored spike code, out of scope.
Goal: ff mod.rs | wc -l == 0 for src/, permanently enforced.

Complexity

Estimate: small
Reasoning: Mechanical git mv foo/mod.rs foo.rs per module (6x), no
logic changes; plus one Cargo.toml lint line and one Makefile gate target.

Scope

  1. For each of vfs, record, parser, schema, btree, pager: git mv src/<m>/mod.rs src/<m>.rs. No content changes, no behavior change.
  2. Add self_named_module_files = "deny" to [lints.clippy] in
    Cargo.toml (clippy restriction lint — forbids foo/mod.rs in favor of
    foo.rs), matching the existing deny-list style (unwrap_used,
    expect_used, etc.) already there.
  3. Add a mod-files gate to the Makefile (alongside grammar-drift,
    mvl-limit) that fails if any mod.rs exists under src/, and wire it
    into whatever aggregate gate target composes those checks.

Acceptance Criteria

  • find src -name mod.rs returns nothing
  • cargo clippy --all-targets -- -D warnings catches a reintroduced
    mod.rs via self_named_module_files
  • make mod-files (or equivalent) fails on a reintroduced mod.rs and
    passes otherwise; wired into CI same as lint/grammar-drift
  • tests/spike/.../lemon-rs left untouched (vendored, out of scope)

Additional Notes

Belt-and-suspenders: the clippy lint alone should already catch this in
make lint; the Makefile target is a cheap, dependency-free backstop for
anyone running gates without clippy (and self-documents the goal each time
gates run).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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