Skip to content

Package.init, log if manifest contains unexpected lua types - #23

Open
D-Berg wants to merge 1 commit into
stack/mpovmztvxkwlfrom
stack/sltyzvutuokp
Open

Package.init, log if manifest contains unexpected lua types#23
D-Berg wants to merge 1 commit into
stack/mpovmztvxkwlfrom
stack/sltyzvutuokp

Conversation

@D-Berg

@D-Berg D-Berg commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Bug Fixes
    • Corrected the package-name validation error.
    • Added clearer diagnostic logging when package name or version values have invalid types.
  • Style
    • Improved code spacing and formatting.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e04ebbc0-3525-40f2-8bc9-554e5a601133

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/Package.zig`:
- Around line 192-194: Update the `else` branch of the `name` type switch in
`Package` to report that the package name was expected to be a string, replacing
the incorrect function type in the `log.err` diagnostic while preserving the
existing error return.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3d899089-fe03-452a-bb94-a152ee6434ae

📥 Commits

Reviewing files that changed from the base of the PR and between 0134f72 and 5546a14.

📒 Files selected for processing (1)
  • src/Package.zig

Comment thread src/Package.zig
Comment on lines +192 to +194
else => |kind| {
log.err("Package expected name to be function, got {t}", .{kind});
return error.WrongLuaType;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Correct the expected type in the name diagnostic.

The switch accepts only .string, but the log says that name must be a function. Report string instead.

Proposed fix
-            log.err("Package expected name to be function, got {t}", .{kind});
+            log.err("Package expected name to be string, got {t}", .{kind});
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
else => |kind| {
log.err("Package expected name to be function, got {t}", .{kind});
return error.WrongLuaType;
else => |kind| {
log.err("Package expected name to be string, got {t}", .{kind});
return error.WrongLuaType;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/Package.zig` around lines 192 - 194, Update the `else` branch of the
`name` type switch in `Package` to report that the package name was expected to
be a string, replacing the incorrect function type in the `log.err` diagnostic
while preserving the existing error return.

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.

1 participant