diff --git a/Makefile b/Makefile index c219f36..6698ccd 100644 --- a/Makefile +++ b/Makefile @@ -2,10 +2,14 @@ # BEGIN: lint-install . # http://github.com/codeGROOVE-dev/lint-install -.PHONY: lint test +.PHONY: lint test build test: go test -race ./... +build: + mkdir -p out + go build -o out/prs . + lint: _lint LINT_ARCH := $(shell uname -m) diff --git a/README.md b/README.md index a47b101..d860dc7 100644 --- a/README.md +++ b/README.md @@ -1,75 +1,35 @@ -# 🚀 prs +# prs -> Only shows PRs waiting on YOU +GitHub CLI tool that shows which PRs that are actually waiting on you. That's it. -A fast CLI that filters GitHub PRs to show only what needs your attention. No more digging through dozens of PRs to find the ones that actually need you. +Designed to be easily used for embedded low-power displays, or your shell initialization. -## Quick Start +## Install ```bash -go install github.com/ready-to-review/prs@latest -prs +go install github.com/codeGROOVE-dev/prs@latest ``` -**Requirements:** Go 1.23+ and GitHub CLI (`gh`) authenticated +Requires Go 1.23+ and `gh` auth. ## Usage ```bash -# Show PRs you're involved with (filters out stale PRs) -prs - -# Only PRs waiting for your review -prs --blocked - -# Include old/stale PRs -prs --include-stale - -# Auto-refresh view -prs --watch - -# Get notified when PRs need attention -prs --notify +prs # PRs you're involved with +prs --blocked # Only PRs waiting for you +prs --include-stale # Include ancient PRs +prs --watch # Live updates +prs --exclude-orgs google # Skip an organization (comma-separated) ``` -## What You'll See - -### Default View (`prs`) ![Default View](media/default.png) -### Live Focus Mode (`prs --blocked --watch`) -![Watch Blocked View](media/watch_blocked.png) - -## Options - -- `--blocked` - Only PRs blocking on you -- `--include-stale` - Include old PRs (hidden by default) -- `--watch` - Live updates with real-time WebSocket + polling -- `--exclude-orgs` - Comma-separated list of organizations to exclude -- `--verbose` - Show detailed logging - -### Color Output - -Colors are automatically adjusted based on your terminal capabilities. To disable colors entirely: - -```bash -NO_COLOR=1 prs -``` - -This respects the [NO_COLOR](https://no-color.org/) standard. - -## Status Icons +![Watch Mode](media/watch_blocked.png) -- 🚧 Draft PR -- ✅ Ready to merge -- 👍 Has approval -- 💥 Merge conflict -- ⏰ Stale PR -- ❌ Failing tests -- 📝 Regular PR +Colors disabled with `NO_COLOR=1`. -## Why This Tool? +## Real-time support -Stop context switching through GitHub tabs. This tool uses smart filtering to show only PRs that actually need your input - not PRs waiting on CI, other reviewers, or ones you've already reviewed. +Due to GitHub webhook limitations, real-time updates are only available for GitHub orgs that install the [Ready to Review](https://github.com/apps/ready-to-review-beta) GitHub app. -Built fast in Go because your development tools shouldn't slow you down. +Without the app, PRs are updated every minute, which should be enough for anyone TBH. diff --git a/main.go b/main.go index 9574cca..21f6528 100644 --- a/main.go +++ b/main.go @@ -106,7 +106,7 @@ func (t *prRefreshTracker) markRefreshed(prURL string) { const ( defaultTimeout = 30 * time.Second - defaultWatchInterval = 90 * time.Second + defaultWatchInterval = 60 * time.Second maxPerPage = 100 retryAttempts = 3 retryDelay = time.Second @@ -1081,7 +1081,7 @@ func generatePRDisplay(prs []PR, username string, blockingOnly, verbose, include } // Outgoing PRs with integrated header - if len(outgoing) > 0 && !blockingOnly { + if len(outgoing) > 0 && (!blockingOnly || outgoingBlockingCount > 0) { if len(incoming) > 0 { output.WriteString("\n") } @@ -1105,6 +1105,9 @@ func generatePRDisplay(prs []PR, username string, blockingOnly, verbose, include output.WriteString(":\n") for i := range outgoing { + if blockingOnly && !isBlockingOnUser(&outgoing[i], username) { + continue + } output.WriteString(formatPR(&outgoing[i], username)) } } diff --git a/main_test.go b/main_test.go index 59b5c9d..cb47dee 100644 --- a/main_test.go +++ b/main_test.go @@ -1,6 +1,7 @@ package main import ( + "strings" "testing" ) diff --git a/media/default.png b/media/default.png index bff188d..d30a0b4 100644 Binary files a/media/default.png and b/media/default.png differ diff --git a/media/watch_blocked.png b/media/watch_blocked.png index 6620c75..bf6dfcd 100644 Binary files a/media/watch_blocked.png and b/media/watch_blocked.png differ