Skip to content

feat(rules,allowlist): support go.mod/go.work review and Cargo test path conventions #1970

Closed

Description

@alex09x

Problem Statement

  1. go.mod and go.work are skipped as unsupported_ext and have no built-in rule.
    File selection checks only the file extension (.mod, .work), so go.mod and go.work changes are dropped before review (for example, ocr delegate preview --commit b842659 in this repository selects 0 of 2 files), and ocr rules check go.mod falls back to default.md even though go.md asks the reviewer to check the module's go directive. Adding .mod to supported_file_types.json is not an option because .mod is also used by binary Fortran module files and Linux kernel build artifacts.

  2. Standard Cargo test and benchmark paths are not excluded by default.
    default_exclude_patterns.json only lists "**/*_test.rs" for Rust, so standard Cargo integration tests (tests/**/*.rs), module test files (tests.rs, *_tests.rs), and benchmarks (benches/**/*.rs) are reviewed as production code against rust.md. Across three multi-file Rust commits we tested, test files accounted for 56% (421/750), 30% (77/257), and 24% (135/557) of reviewed insertions.

Proposed Solution

  • Allow exact filenames (go.mod, go.work) in the file allowlist while keeping go.sum, go.work.sum, and arbitrary *.mod / *.work files excluded.
  • Add a built-in go_mod.md rule for **/go.mod and **/go.work in system_rules.json (and the localized review-rules.md tables).
  • Add "**/tests/**/*.rs", "**/*_tests.rs", "**/tests.rs", and "**/benches/**/*.rs" to default_exclude_patterns.json, and align rust.md with the precision-first guidance used in go.md and swift.md.

A PR implementing both changes is opened right after this issue and can be split into two separate PRs if you prefer.

Alternatives Considered

Per-repo .opencodereview/rule.json include/exclude rules work as a local workaround, but go.mod and Cargo's tests/ and benches/ layouts are standard toolchain conventions.

Affected Area

  • Review Rules
  • Review Agent / LLM interaction

Additional Context

AI disclosure: used Google Antigravity (Gemini) and Claude Code while inspecting the codebase and writing this change.

Activity

  1. wu21-web commented on Nov 18, 2026

    @wu21-web
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions