#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.
#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.mdsfiles are partials (_name.mds).Reproduction (built from PR #385 head):
Cause: the walker (
crates/mds-cli/src/output.rs,collect_mds_files_detailed) collects partials, sofiles.is_empty()is false and the new empty-tree arm inrun_build_directory(crates/mds-cli/src/build.rs) is bypassed; the per-file loop then skips every partial via the existingis_partialgate 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 forbuild/checkonly (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 todir_build_empty_dir_exits_oneincrates/mds-cli/tests/dir_build.rs.Refs #204, #385.