Skip to content

refactor: make scanner an importable package with real GitHub client#5

Merged
packet-mover merged 1 commit intomainfrom
refactor/importable-scanner-package
Apr 5, 2026
Merged

refactor: make scanner an importable package with real GitHub client#5
packet-mover merged 1 commit intomainfrom
refactor/importable-scanner-package

Conversation

@packet-mover
Copy link
Copy Markdown
Contributor

@packet-mover packet-mover commented Apr 5, 2026

Summary

  • Refactor from package main to package scanner — the module is now importable by the GitHub App repo via scanner.Run(ctx, cfg)
  • Add real GitHubClient implementation (REST API with pagination)
  • Make Rule an interface with concrete types per rule (HasRepoDescription); Check returns bool
  • Move main.go to cmd/scanner/main.go as a thin CLI wrapper
  • Mock moved to test-only file (client_mock_test.go)
  • Update AGENTS.md: new repo layout, adjusted Phase 2/3 workflow (uncommitted changes for IDE review before commit)

Test plan

  • go test ./... passes
  • go vet ./... clean
  • Verify go build ./cmd/scanner produces a working binary

- Change all files from package main to package scanner
- Add real GitHubClient implementation (REST API with pagination)
- Add ListFiles to GitHubClient interface (stub for upcoming rules)
- Add Run() as high-level entry point: constructs client, scans, returns
- Add Config struct (Org, Token, ReportRepo) for callers
- Make Rule an interface with concrete types per rule (HasRepoDescription)
- Rule.Check returns bool; RuleResult assembled in scanner
- Move main.go to cmd/scanner/main.go as thin CLI wrapper
- Rename client_mock.go to client_mock_test.go (test-only)
- Update AGENTS.md repo layout and Phase 2/3 workflow

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@packet-mover packet-mover merged commit 2874f6f into main Apr 5, 2026
2 checks passed
@packet-mover packet-mover deleted the refactor/importable-scanner-package branch April 5, 2026 19:09
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