Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the MoonBit project to reduce/avoid warnings by modernizing error definitions and try-handling, migrates package configuration from moon.pkg.json to moon.pkg, and adds/updates GitHub Actions workflows to build/test (and publish on releases).
Changes:
- Convert
suberror X Stringdefinitions to the block/variant form in multiple modules. - Replace
try? ... .unwrap()patterns withtry!in tests and the JS main entry. - Migrate MoonBit package config to
moon.pkgfiles, bump module version to0.2.2, and add a release publishing workflow.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/writer.mbt | Updates FormatCirruError definition to block/variant form. |
| src/s_expr.mbt | Updates FormatError definition and switches string slicing error handling to try!. |
| src/parser_test.mbt | Uses try! in tests for parsing/JSON parsing. |
| src/parser.mbt | Updates CirruParseError definition to block/variant form. |
| src/moon.pkg.json | Removes legacy MoonBit package JSON config. |
| src/moon.pkg | Adds new MoonBit package config with imports and test-only deps. |
| src/main/moon.pkg.json | Removes legacy MoonBit package JSON config for main package. |
| src/main/moon.pkg | Adds new MoonBit package config for the main package (including is-main). |
| src/main/main.mbt | Uses try! for JSON parsing/from_json and formatting. |
| moon.mod.json | Bumps module version from 0.2.1 to 0.2.2. |
| .gitignore | Ignores _build and .github/skills/. |
| .github/workflows/release.yml | Adds release workflow to run checks and publish to MoonBit registry. |
| .github/workflows/check.yml | Switches CI MoonBit installation to hustcer/setup-moonbit@v1. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| run: moon update && moon version && moon check --target js | ||
|
|
||
| - name: moon test | ||
| run: moon build --target js --debug |
There was a problem hiding this comment.
The step named "moon test" is running moon build --target js --debug, which does not execute the test suite. Rename the step to reflect what it does or switch the command to moon test (and keep build as a separate step if needed) so releases don’t bypass tests.
| run: moon build --target js --debug | |
| run: moon test --target js --debug |
| - name: setup credentials | ||
| run: | | ||
| mkdir -p ~/.moon | ||
| echo '${{ secrets.MOON_CREDENTIALS }}' > ~/.moon/credentials.json |
There was a problem hiding this comment.
Writing ${{ secrets.MOON_CREDENTIALS }} with echo is brittle because echo can treat leading -n/-e as options and it always appends a newline, which can corrupt the credentials payload. Use a safer write (e.g., printf '%s' or a heredoc) to ensure the secret is written verbatim.
| echo '${{ secrets.MOON_CREDENTIALS }}' > ~/.moon/credentials.json | |
| printf '%s' '${{ secrets.MOON_CREDENTIALS }}' > ~/.moon/credentials.json |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 13 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.