目录

Moon Doctor

Moon Doctor is a release-readiness checker for MoonBit projects. It scans a project directory and reports whether the repository has the metadata, license, tests, examples, and documentation that make it easier to publish on GitHub or mooncakes.

The first version is intentionally offline and conservative. It does not replace moon check, moon test, or the official MoonBit toolchain; it gives project owners a practical checklist before sharing a package with the community.

Why Moon Doctor

MoonBit packages are easier to reuse when repository quality is visible: clear metadata, a license, examples, tests, and CI all make a project safer to try. Moon Doctor turns those release-readiness habits into a repeatable local check.

What It Checks

Moon Doctor looks for:

  • Required files: moon.mod, README.md, and LICENSE.
  • Recommended repository files: .gitignore, GitHub Actions workflows, tests, and examples.
  • Important moon.mod fields: name, version, readme, repository, license, description, and keywords.
  • Release hygiene: README usage/development/license sections and consistency between moon.mod license metadata and the LICENSE file.
  • Ecosystem polish: repository URL shape, readme target existence, .gitignore coverage for MoonBit build artifacts, CI commands, and usable examples.

Findings are grouped as ERROR, WARN, and INFO, then summarized with an overall grade.

Rule Categories

  • ERROR: missing fundamentals that block a clean public release.
  • WARN: important gaps that should be fixed before sharing widely.
  • INFO: quality improvements that help discovery, contribution, or cleanup.

Usage

Check the current directory:

moon run cmd/main

Check another MoonBit project:

moon run cmd/main -- fixtures/good_project

Example output:

Moon Doctor report
Project: fixtures/good_project
Conclusion: Ready for GitHub
Grade: A (pass)
Findings: 0 error(s), 0 warning(s), 0 info item(s)

Diagnostics
- No findings.

Suggested validation
- moon check
- moon test

Release checklist
- Review README.md and LICENSE
- Run moon check
- Run moon test
- Run moon package before publishing to mooncakes
- Push the repository with the prepared Git history

Check a project with a missing license:

moon run cmd/main -- fixtures/missing_license

Check a project with weak CI metadata:

moon run cmd/main -- fixtures/weak_ci_project

Development

moon check
moon test
moon run cmd/main -- fixtures/good_project
moon run cmd/main -- fixtures/missing_license
moon run cmd/main -- fixtures/minimal_project
moon run cmd/main -- fixtures/weak_ci_project

Non-goals

Moon Doctor v1 does not run external commands automatically, access GitHub, or publish packages. It is a local preflight checklist. Run the official MoonBit commands separately before release:

moon check
moon test
moon package

License

MIT License.

关于
58.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号