Skip to content

feat: add outline command stub#2689

Merged
HerringtonDarkholme merged 1 commit into
mainfrom
outline-command
Jun 7, 2026
Merged

feat: add outline command stub#2689
HerringtonDarkholme merged 1 commit into
mainfrom
outline-command

Conversation

@HerringtonDarkholme

@HerringtonDarkholme HerringtonDarkholme commented Jun 7, 2026

Copy link
Copy Markdown
Member

Summary

  • add the initial outline subcommand stub with required file/directory paths
  • keep output intentionally empty until extraction/model/rendering land in later PRs
  • preserve the previous builtin-rule draft as a commented reference for future slices

Test

  • cargo test -p ast-grep test_outline --lib
  • commit hook: fmt, cargo check, clippy

Summary by CodeRabbit

  • New Features

    • The outline subcommand now accepts path arguments and executes successfully.
  • Tests

    • Updated CLI test coverage for the outline subcommand with additional argument-parsing scenarios and edge case handling.

@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5ba37627-5929-4bd5-b633-0b93db13c6ac

📥 Commits

Reviewing files that changed from the base of the PR and between a19010d and 17986cf.

📒 Files selected for processing (3)
  • crates/cli/src/lib.rs
  • crates/cli/src/outline.rs
  • crates/cli/src/outline/default_rule.rs

📝 Walkthrough

Walkthrough

The outline subcommand is scaffolded with a required paths CLI argument and a stub implementation that ignores paths and prints a placeholder message. Legacy builtin default rules are disabled via block comment. Test coverage is refactored to validate the reduced argument-parsing scenarios.

Changes

Outline command stub and default rules cleanup

Layer / File(s) Summary
Outline argument structure and command stub
crates/cli/src/outline.rs, crates/cli/src/lib.rs
OutlineArg now requires a paths: Vec<PathBuf> positional argument; run_outline accepts the arg, ignores paths, prints "No outline items found.", and returns ExitCode::SUCCESS; the default_rule module import is removed. Test coverage is updated to verify valid outline invocations and reduced invalid cases.
Disable legacy builtin outline rules
crates/cli/src/outline/default_rule.rs
The entire DEFAULT_OUTLINE_RULES content is wrapped in a block comment with a note that builtin outline rules are prototype code not intended for compilation or shipping.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • ast-grep/ast-grep#2685: Both PRs directly modify the crates/cli/src/outline.rs and crates/cli/src/outline/default_rule.rs implementations—this PR stubs the outline command and disables default rules, while the related PR introduces full outline extraction logic and re-enables DEFAULT_OUTLINE_RULES.

Poem

🐰 Outline takes shape with paths to explore,
stub returns success, for now nothing more.
Legacy rules sleep in comment block dreams,
tested and ready for future schemes! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch outline-command

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@HerringtonDarkholme
HerringtonDarkholme added this pull request to the merge queue Jun 7, 2026
Merged via the queue into main with commit a2ccbd1 Jun 7, 2026
3 of 4 checks passed
@HerringtonDarkholme
HerringtonDarkholme deleted the outline-command branch June 7, 2026 19:12
@codecov

codecov Bot commented Jun 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 55.55556% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.42%. Comparing base (7b9372c) to head (17986cf).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
crates/cli/src/outline.rs 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2689      +/-   ##
==========================================
+ Coverage   86.34%   86.42%   +0.07%     
==========================================
  Files         117      117              
  Lines       20196    20187       -9     
==========================================
+ Hits        17439    17447       +8     
+ Misses       2757     2740      -17     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant