Skip to content

handle warnings#15

Open
tiye wants to merge 1 commit intomainfrom
warning
Open

handle warnings#15
tiye wants to merge 1 commit intomainfrom
warning

Conversation

@tiye
Copy link
Member

@tiye tiye commented Feb 18, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 18, 2026 13:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 String definitions to the block/variant form in multiple modules.
  • Replace try? ... .unwrap() patterns with try! in tests and the JS main entry.
  • Migrate MoonBit package config to moon.pkg files, bump module version to 0.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
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
run: moon build --target js --debug
run: moon test --target js --debug

Copilot uses AI. Check for mistakes.
- name: setup credentials
run: |
mkdir -p ~/.moon
echo '${{ secrets.MOON_CREDENTIALS }}' > ~/.moon/credentials.json
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
echo '${{ secrets.MOON_CREDENTIALS }}' > ~/.moon/credentials.json
printf '%s' '${{ secrets.MOON_CREDENTIALS }}' > ~/.moon/credentials.json

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants