Conversation
qudix
commented
Nov 12, 2025
- i dunno how this lingered for 4 years without anyone noticing, but i only got an error about it today
Summary of ChangesHello @qudix, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical, albeit small, typo within the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request fixes a long-standing typo in lock_packages.lua, changing so.subarch() to os.subarch(). This prevents a runtime error when determining the architecture for package locking. The fix is correct. I've added a suggestion to make the architecture and platform resolution more robust by asserting that a value is always found, preventing potential nil value errors during key creation.
| if project.policy("package.requires_lock") then | ||
| local plat = config.plat() or os.subhost() | ||
| local arch = config.arch() or so.subarch() | ||
| local arch = config.arch() or os.subarch() |
There was a problem hiding this comment.
While this correctly fixes the typo, there's a potential for a runtime error if both config.arch() and os.subarch() return nil. This would cause arch to be nil, leading to an error on the next line when concatenating it to form the key.
To make the code more robust, you can use assert to ensure that arch gets a valid value.
A similar improvement could be applied to the plat variable on the preceding line for consistency.
local arch = assert(config.arch() or os.subarch(), "could not determine architecture")