Skip to content

feat(allowlist): add Mojo support - #977

Open
wakqasahmed wants to merge 1 commit into
alibaba:mainfrom
wakqasahmed:feat/issue-470-mojo-support
Open

feat(allowlist): add Mojo support#977
wakqasahmed wants to merge 1 commit into
alibaba:mainfrom
wakqasahmed:feat/issue-470-mojo-support

Conversation

@wakqasahmed

Copy link
Copy Markdown
Contributor

Summary

  • Add .mojo and .🔥 to the supported file types allowlist
  • No default exclude pattern added — Mojo tooling has not settled on a conventional test-directory layout yet, so allowed_ext_test.go documents this explicitly (matching the existing Prisma/Shader precedent)
  • Add internal/config/rules/rule_docs/mojo.md, a Mojo review rule doc covering ownership/borrowing conventions (borrowed/inout/owned argument mismatches, unintended transfers with ^, __copyinit__/__moveinit__/__del__ correctness), value semantics and struct design, unsafe pointer and C/Python FFI interop, the PythonObject interop boundary, parallelize/vectorize concurrency hazards, Mojo-specific performance anti-patterns, and security-sensitive raw-pointer/deserialization concerns
  • Register **/*.{mojo,🔥} -> mojo.md in system_rules.json
  • Add test coverage: allowed-extension matching (both extensions, including the fire-emoji extension), non-exclusion of Mojo files, and rule resolution

Part of the language-allowlist expansion tracked in #470.

Closes #976

Test plan

  • go test ./internal/config/allowlist/... -run 'TestIsAllowedExt|TestIsExcludedPath' -v — PASS
  • go test ./internal/config/rules/... -run TestResolve_DefaultRules -v — PASS
  • gofmt -s -l . — clean
  • go vet ./internal/config/... — clean
  • go run scripts/verify-english-only.go — clean (423 files scanned, no unapproved non-English text)

Add .mojo and .🔥 to the supported file types allowlist, a mojo.md
review rule doc covering ownership/borrowing (borrowed/inout/owned,
transfer semantics, copyinit/moveinit/del), unsafe pointer and FFI
interop, the PythonObject boundary, parallelize/vectorize concurrency
hazards, and Mojo-specific performance anti-patterns, and register
the glob-to-rule mapping in system_rules.json. No conventional
test-file exclusion pattern exists for Mojo yet.

Part of the language-allowlist expansion tracked in alibaba#470.
@github-actions

Copy link
Copy Markdown
Contributor

OpenCodeReview: Review complete: 0 finding(s) across 2 selected item(s).

@wu21-web wu21-web left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Site documentation updates missing, update at pages/src/content/docs/<locale>/review-rules.md.

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.

feat(allowlist): add Mojo support

2 participants