Skip to content

Latest commit

Β 

History

History
174 lines (126 loc) Β· 4.82 KB

File metadata and controls

174 lines (126 loc) Β· 4.82 KB

by ossiqn

text

ghost πŸ‘»

Dead code & unused dependency hunter

Go Version License Release Stars

ghost demo


What is ghost?

Every codebase has them.

Functions that were written but never called. Imports that made sense six months ago. Dependencies that somehow survived three refactors.

ghost finds them all. In seconds. $ ghost scan .

πŸ‘» ghost scan complete 47 files scanned

Dead Functions: ──────────────────────────────────────────────────────────── src/utils/helper.go:42 └─ func calculateOldPrice() β†’ never called

src/api/routes.go:89 └─ func legacyHandler() β†’ never called

Unused Imports: ──────────────────────────────────────────────────────────── src/models/user.go:12 └─ import "fmt" β†’ never used

Ghost Dependencies: ──────────────────────────────────────────────────────────── go.mod └─ github.com/old/package β†’ not imported anywhere └─ github.com/unused/lib β†’ not imported anywhere

──────────────────────────────────────────────────────────── πŸ‘» 2 dead functions πŸ‘» 1 unused imports πŸ‘» 0 unused variables πŸ‘» 2 ghost dependencies

πŸ’Ύ Est. size saved: ~2.4MB

Run ghost clean to remove all? (y/n):

text


Install

Go Install go install github.com/ossiqn/ghost@latest

text

Binary

Download from Releases


Usage

ghost scan . scan current directory ghost scan ./myproject scan specific path ghost scan . --clean scan and auto clean ghost scan . --json output as JSON ghost scan . --lang go scan only Go files ghost scan . --lang js scan only JS/TS files ghost scan . --lang python scan only Python files ghost scan . --lang rust scan only Rust files ghost scan . --lang ruby scan only Ruby files ghost scan . --lang java scan only Java files ghost scan . --verbose verbose output ghost version print version

text


Language Support

Language Dead Functions Unused Imports Unused Variables Dependencies
Go βœ… βœ… βœ… βœ… go.mod
JavaScript βœ… βœ… βœ… βœ… package.json
TypeScript βœ… βœ… βœ… βœ… package.json
Python βœ… βœ… βœ… βœ… requirements
Rust βœ… βœ… βœ… βœ… Cargo.toml
Ruby βœ… βœ… πŸ”œ πŸ”œ Gemfile
Java βœ… βœ… πŸ”œ πŸ”œ pom.xml

CI/CD Integration

name: Ghost Scan

on: [push, pull_request]

jobs:
  ghost:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install ghost
        run: go install github.com/ossiqn/ghost@latest

      - name: Scan
        run: ghost scan . --json > ghost-report.json

      - name: Upload report
        uses: actions/upload-artifact@v4
        with:
          name: ghost-report
          path: ghost-report.json
Why ghost?
Tool	Dead Functions	Multi-Language	Dependencies	CLI
ghost	βœ…	βœ…	βœ…	βœ…
ESLint	❌	JS only	❌	βœ…
gopls	Partial	Go only	❌	❌
depcheck	❌	JS only	βœ…	βœ…
vulture	βœ…	Python only	❌	βœ…
Roadmap
 Go support
 JavaScript / TypeScript support
 Python support
 Rust support
 Ruby support
 Java support
 C# support
 PHP support
 Auto-fix mode
 VS Code extension
 Web dashboard
Contributing
text

git clone https://github.com/ossiqn/ghost
cd ghost
go mod tidy
go test ./...
PRs are welcome.
Open an issue first for major changes.

<div align="center">
made with πŸ–€ by ossiqn

ossiqn.com.tr

</div> ```