Skip to content

[repo-assist] feat: add Ruby language support #353

@github-actions

Description

@github-actions

🤖 This PR was created by Repo Assist, an automated AI assistant.

Summary

Adds cognitive complexity analysis for Ruby source code, bringing the supported language count to 10 (C#, Go, Java, JavaScript, TypeScript, JSX, TSX, Python, Rust, Ruby).

Changes

  • New: src/metricsAnalyzer/languages/rubyAnalyzer.tsRubyMetricsAnalyzer class using tree-sitter-ruby
  • New: samples/Test.rb — sample Ruby file demonstrating complexity analysis
  • New: src/test/metricsAnalyzer/languages/rubyAnalyzer.test.ts — VS Code integration tests
  • Updated: src/metricsAnalyzer/metricsAnalyzerFactory.ts — registers ruby language
  • Updated: src/test/suite/index.ts — registers Ruby analyzer tests in the test suite
  • Updated: src/unit/unit.test.ts — 9 new Ruby unit tests + updated stale test references
  • Updated: package.json — adds onLanguage:ruby activation event and tree-sitter-ruby dependency

Cognitive Complexity Rules Implemented

Construct Increment
if, if_modifier +1 + nesting
unless, unless_modifier +1 + nesting
while, while_modifier +1 + nesting
until, until_modifier +1 + nesting
for +1 + nesting
case +1 + nesting
elsif, else, when, rescue +1 (flat)
? : ternary +1
&&, ||, and, or +1 each
nested block/lambda +1 + nesting (when nesting > 0)

Method Naming

  • Instance methods: ClassName#method_name
  • Class methods (singleton): ClassName.method_name
  • Module methods: ModuleName.method_name
  • Top-level methods: method_name

Test Status

  • npm run compile — ✅ passes
  • npm run lint — ✅ passes
  • Unit tests (112 total) — ✅ all pass
  • VS Code integration tests — ⚠️ requires VS Code download (expected in CI sandboxes)

Note: tree-sitter-ruby@^0.23.1 has peer dep tree-sitter: ^0.21.1, compatible with the current tree-sitter@0.21.1.


Warning

Protected Files — Push Permission Denied

This was originally intended as a pull request, but the patch modifies protected files. A human must create the pull request manually.

Protected files
  • package-lock.json
  • package.json

The push was rejected because GitHub Actions does not have workflows permission to push these changes, and is never allowed to make such changes, or other authorization being used does not have this permission.

Create the pull request manually
# Download the patch from the workflow run
gh run download 26739249308 -n agent -D /tmp/agent-26739249308

# Create a new branch
git checkout -b repo-assist/feat-ruby-support-20260601-0161c15ee6c00dd5 main

# Apply the patch (--3way handles cross-repo patches)
git am --3way /tmp/agent-26739249308/aw-repo-assist-feat-ruby-support-20260601.patch

# Push the branch and create the pull request
git push origin repo-assist/feat-ruby-support-20260601-0161c15ee6c00dd5
gh pr create --title '[repo-assist] feat: add Ruby language support' --base main --head repo-assist/feat-ruby-support-20260601-0161c15ee6c00dd5 --repo askpt/code-metrics

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • releaseassets.githubusercontent.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "releaseassets.githubusercontent.com"

See Network Configuration for more information.

Generated by 🌈 Repo Assist, see workflow run. Learn more.

Add this agentic workflows to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@dcdf09723d42ef9b6c75335e4612fd145d4ccdaa

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions