Skip to content

fix(guard): keep only iOS whole after a one-letter prefix (#905) - #906

Merged
apotema merged 2 commits into
mainfrom
fix/guard-leading-acronym
Sep 29, 2026
Merged

apotema merged 2 commits into
mainfrom
fix/guard-leading-acronym

Conversation

@apotema

@apotema apotema commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Closes #905.

The tokenizer's lowercase-leading acronym rule kept any one-letter lowercase prefix glued to the capitals after it. So xSDLConfig read as xSDL|Config, pWGPUDevice as pWGPU|Device, and neither backend name was reported.

This restricts the exception to the literal iOS it exists for. Other prefixes are ordinary camelCase again (x|SDL|Config). iOSConfig, iOs and the embedded forms from #903 keep working.

Tests: new cases xSDLConfig, pWGPUDevice and iSDLPath. zig build test-guard passes 17/17, and src/ stays clean with the current allowlist.

The same fix goes to the labelle-cli core guard, where this guard came from (companion PR).


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

The lowercase-leading acronym rule kept any one-letter lowercase prefix
glued to the capitals after it, so xSDLConfig read as xSDL|Config and
pWGPUDevice as pWGPU|Device, and neither backend name was reported.
Restrict the exception to the literal iOS it exists for. Other prefixes
are ordinary camelCase again (x|SDL|Config).
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 100 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: f96b14db-9944-4757-919e-b154cd6b66be

📥 Commits

Reviewing files that changed from the base of the PR and between eb37d65 and 47a96fc.

📒 Files selected for processing (1)
  • test/agnostic_guard_test.zig

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T19:48:13.433737Z 47a96fc New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

A word ending in `i` before a generic OS (multiOSConfig) spells the same
letters as getiOSConfig, so the guard reads it as iOS too. It cannot tell
the two apart, and a false finding is cheaper than a missed platform name.
Document the trade-off and the workaround (multi_os_config), and pin it
with a test.
@apotema
apotema merged commit 6ce947c into main Sep 29, 2026
4 checks passed
@apotema
apotema deleted the fix/guard-leading-acronym branch September 29, 2026 13:27
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.

agnostic guard: leading-acronym exception hides backend names after a one-letter prefix (xSDLConfig)

2 participants