Skip to content

Inline directives in Ruby, Rust, Java, C# and other languages are silently ignored #7

Closed

Description

@ilanh

Summary

Only JS/TS, Python, Go and shell files are lexed (src/lexer.rs, Language::from_path). @openshell comments in any other language (Ruby, Rust, Java, C#, Kotlin, PHP, ...) are ignored with no warning.

Steps to reproduce

  1. Create a.rb:
    # @openshell egress api.x.com:443 reason="r" bin=/usr/bin/ruby
    Net::HTTP.get(URI("https://api.x.com/"))
  2. openshell-annotate scan .
  3. openshell-annotate generate . and openshell-annotate lint .

Seen with real projects: pocketrb (Ruby) and anthropic-proxy-rs (Rust).

Expected

  • A warning when a repo contains many source files in languages that are not scanned (for example "12 .rb files not scanned").
  • A way to declare the comment leader for extra extensions, for example [languages.extra] rb = "hash" (#) or rs = "slash" (//), so Ruby and Rust inline directives work.

Actual

scan says 0 directive(s), generate only warns policy is empty, lint reports nothing for the .rb file.

Notes

  • A .sh sidecar file with the directives works today and should be documented as the recommended workaround.
  • A first-class sidecar file (openshell.annotations.yaml) is tracked separately as a follow-up.

Found while testing five real projects (see the local candidate report). Numbered #1 in that report.

Activity

  1. added
    bugSomething is not working
    scanopenshell-annotate scan
    languagesSource language and comment support
    on Nov 3, 2026
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

    bugSomething is not workinglanguagesSource language and comment supportscanopenshell-annotate scan

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions