Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Copilot Setup Steps

# This workflow defines the setup steps that GitHub Copilot agents will use
# to prepare the development environment for the cargo-shear project.
# It preinstalls tools and dependencies needed for Rust development.

on:
workflow_dispatch:
pull_request:
types: [opened, synchronize]
paths:
- .github/workflows/copilot-setup-steps.yml
push:
branches:
- main
paths:
- .github/workflows/copilot-setup-steps.yml

permissions: {}

jobs:
copilot-setup-steps:
name: Setup Development Environment for Copilot
runs-on: ubuntu-latest
steps:
# Checkout full repo for git history.
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false

- uses: oxc-project/setup-rust@ecabb7322a2ba5aeedb3612d2a40b86a85cee235 # v1.0.11
with:
cache-key: warm
save-cache: false
tools: just,cargo-insta,typos-cli,taplo-cli
components: clippy rust-docs rustfmt rust-analyzer
30 changes: 30 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# cargo-shear

Detect and fix unused dependencies, misplaced dependencies, and unlinked source files in Rust projects.

## Development

Run `just ready` after making code changes to ensure code quality and all tests pass.

### Frequent Commands

- `just ready` - Run full quality checks (typos, fmt, check, lint, test)
- `just fmt` - Format code with rustfmt and taplo
- `just lint` - Run clippy
- `just snapshots` - Accept all snapshot test changes
- `cargo test` - Run all tests
- `cargo check` - Quick compile check

## Key Modules

- `src/lib.rs` - Core library functionality
- `src/package_analyzer.rs` - Analyzes package dependencies
- `src/source_parser.rs` - Parses Rust source files for imports
- `src/cargo_toml_editor.rs` - Edits Cargo.toml files
- `src/package_processor.rs` - Processes packages in workspaces

## Testing

- Integration tests: `tests/integration_tests.rs`
- Test fixtures: `tests/fixtures/`
- Snapshot tests use `cargo-insta`