Skip to content

mds build/check/fmt/lint <dir> exits 0 when the only .mds files are partials (_foo.mds) — same silent-green shape as #204 #387

Description

@dean0x

#204 (PR #385) made an EMPTY directory exit non-zero (no .mds files found in <dir>; nothing was built, exit 1; lint exit 2), matching the pre-existing all-excluded diagnostic. One sibling case still passes silently: a directory whose only .mds files are partials (_name.mds).

Reproduction (built from PR #385 head):

mkdir p && printf '# partial\n' > p/_only.mds
mds build p --out-dir out    # exit 0, "0 built, 0 failed" (or equivalent), nothing written

Cause: the walker (crates/mds-cli/src/output.rs, collect_mds_files_detailed) collects partials, so files.is_empty() is false and the new empty-tree arm in run_build_directory (crates/mds-cli/src/build.rs) is bypassed; the per-file loop then skips every partial via the existing is_partial gate and the run ends with nothing produced and exit 0.

Whether this is a bug depends on the intended contract for partial-only trees (a partials library that is only ever @imported from elsewhere is a legitimate layout). Options: (a) treat "no non-partial file" like the empty tree for build/check only (fmt/lint legitimately operate on partials); (b) keep exit 0 but print a non-quiet notice; (c) document it as intended. Decide before adding a third diagnostic arm; whichever way, add a pinning test next to dir_build_empty_dir_exits_one in crates/mds-cli/tests/dir_build.rs.

Refs #204, #385.

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

    enhancementNew feature or request

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions