Skip to content

GitHub Bot: Detect unused packages in the projects - #295

Open
konard wants to merge 4 commits into
mainfrom
issue-115-0d631472
Open

GitHub Bot: Detect unused packages in the projects#295
konard wants to merge 4 commits into
mainfrom
issue-115-0d631472

Conversation

@konard

@konard konard commented Sep 13, 2025

Copy link
Copy Markdown
Member

Summary

  • ✅ Implements automated detection of unused packages across multiple programming languages
  • ✅ Supports C# (.csproj), Node.js (package.json), Python (requirements.txt), and Rust (Cargo.toml) projects
  • ✅ Creates comprehensive reports with potentially unused packages
  • ✅ Integrates with existing GitHub bot infrastructure using trigger pattern

Features

  • Multi-language support: Detects unused packages in C#, Node.js, Python, and Rust projects
  • Smart pattern matching: Analyzes source files to determine if packages are actually used
  • Automated reporting: Generates detailed markdown reports with findings
  • Issue-triggered: Activates when issues contain keywords like "detect unused packages"
  • Seamless integration: Uses existing GitHubStorage and trigger infrastructure

Technical Implementation

  • DetectUnusedPackagesTrigger: New trigger class implementing ITrigger interface
  • Enhanced GitHubStorage: Added methods for repository content access and issue commenting
  • Robust analysis: Checks import/using statements, require calls, and package references
  • Error handling: Graceful failure handling with informative error messages

Test plan

  • C# project analysis works correctly
  • Node.js project analysis works correctly
  • Python project analysis works correctly
  • Rust project analysis works correctly
  • Issue trigger condition works as expected
  • Report generation produces readable markdown
  • Bot builds successfully without errors
  • Integration with existing bot infrastructure

🤖 Generated with Claude Code


Resolves #115

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #115
@konard konard self-assigned this Sep 13, 2025
Implements a comprehensive solution for issue #115 to detect unused packages across multiple programming languages including:
- C# (.csproj files with PackageReference)
- Node.js (package.json dependencies)
- Python (requirements.txt)
- Rust (Cargo.toml dependencies)

The bot will automatically scan repositories when issues with titles containing "detect unused packages" or similar keywords are created, analyze source files for actual usage, and provide a detailed report with potentially unused packages.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] GitHub Bot: Detect unused packages in the projects GitHub Bot: Detect unused packages in the projects Sep 13, 2025
@konard
konard marked this pull request as ready for review September 13, 2025 01:18
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>'
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.

GitHub Bot: Detect unused packages in the projects

1 participant