{"id":22118179,"url":"https://github.com/bl-semba-ryuichiro/github-review-comments-counter","last_synced_at":"2025-03-24T06:18:42.488Z","repository":{"id":264236783,"uuid":"892783897","full_name":"bl-semba-ryuichiro/github-review-comments-counter","owner":"bl-semba-ryuichiro","description":"GitHub の PR についたコメントの数を数える","archived":false,"fork":false,"pushed_at":"2024-11-22T21:43:03.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T12:10:30.160Z","etag":null,"topics":["github","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bl-semba-ryuichiro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-22T19:15:12.000Z","updated_at":"2024-11-22T22:06:51.000Z","dependencies_parsed_at":"2024-11-25T15:00:28.372Z","dependency_job_id":null,"html_url":"https://github.com/bl-semba-ryuichiro/github-review-comments-counter","commit_stats":null,"previous_names":["bl-semba-ryuichiro/github-review-comments-counter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bl-semba-ryuichiro%2Fgithub-review-comments-counter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bl-semba-ryuichiro%2Fgithub-review-comments-counter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bl-semba-ryuichiro%2Fgithub-review-comments-counter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bl-semba-ryuichiro%2Fgithub-review-comments-counter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bl-semba-ryuichiro","download_url":"https://codeload.github.com/bl-semba-ryuichiro/github-review-comments-counter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245217946,"owners_count":20579300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github","python"],"created_at":"2024-12-01T13:48:03.812Z","updated_at":"2025-03-24T06:18:42.460Z","avatar_url":"https://github.com/bl-semba-ryuichiro.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# github-review-comments-counter\n\nこのプログラムは、指定した GitHub Pull Request に関連するコメント（Issue コメント、Review コメント、Discussion コメント）を取得し、統計を出力するツールです。\n\n## 機能\n\n- Pull Request に紐づく Issue コメント の数を取得。\n- Pull Request のコードレビューにおける Discussion コメント を「親コメント」「子コメント」に分けてカウント。\n- Pull Request に対する Review コメント をカウント。\n- 除外条件として、特定のユーザーやキーワード、内容が空のコメントをフィルタリング可能。\n\n## プロジェクト構造\n\n```text\ngithub-review-comments-counter/\n├── LICENSE                # プロジェクトのライセンスファイル\n├── README.md              # プロジェクトの説明\n├── pyproject.toml         # Python プロジェクト構成ファイル\n├── .env                   # 環境変数ファイル\n├── .env.example           # 環境変数ファイルのサンプル\n├── github_review_counter/ # パッケージディレクトリ\n│   ├── __init__.py        # パッケージ初期化ファイル\n│   └── client.py          # GitHub API クライアント\n├── utils/                 # ユーティリティ関連\n│   ├── __init__.py        # パッケージ初期化ファイル\n│   └── env.py             # 環境変数処理ヘルパー\n└── main.py                # エントリポイントスクリプト\n```\n\n## 必要な環境\n\n- Python 3.8 以上\n- GitHub Personal Access Token（リポジトリへの読み取り権限が必要）\n\n## インストール\n\n### 1. リポジトリのクローン\n\n```bash\ngit clone https://github.com/bl-semba-ryuichiro/github-review-comments-counter\n```\n\n### 2. 要な依存関係をインストール\n\n```bash\npip install -e .\n```\n\n### 3. `.env` ファイルを作成し、必要な環境変数を設定\n\n`.env.example` を元に `.env` ファイルを作成し、以下の環境変数を設定してください。\n\n```shell\ncp .env.example .env\n```\n\n```text\nGITHUB_TOKEN=ghp_your_personal_access_token\n```\n\nなお、GitHub の Personal Access Token は `repo` スコープが必要です。\n\n## 使い方\n\n### 環境変数を使用する場合\n\n```bash\npython main.py\n```\n\n### コマンドライン引数を使用する場合\n\n引数を指定しなかった場合は、環境変数から値が取得されます。\n\n```bash\npython main.py --owner your_repo_owner --repo your_repo_name --pr_number 123 \\\n    --excluded_users github-actions[bot] another-bot \\\n    --excluded_keywords LGTM \"Looks good\" Approved\n```\n\n## 結果例\n\nプログラム実行時に次のような統計が出力されます。\n\n```text\nコメント統計:\nDiscussion:\n  - 親コメント数: 3 件\n  - 子コメント数: 7 件\nIssue コメント: 4 件\nReview コメント: 5 件\n\nIssue コメント: 4 件\n  - ユーザー: user1, 内容: このプルリクエストはバグ修正を...\n  - ユーザー: user2, 内容: 質問があります。これはどのバ...\n\nDiscussion 親コメント: 3 件\n  - ユーザー: reviewer1, 内容: この部分のロジックが複雑に...\n  - ユーザー: reviewer2, 内容: インデントが崩れています。...\n\nDiscussion 子コメント: 7 件\n  - ユーザー: user3, 内容: 確かに複雑ですね。リファクタ...\n  - ユーザー: user4, 内容: 修正しました。ご確認くださ...\n\nReview コメント: 5 件\n  - ユーザー: reviewer3, 内容: 全体的に問題ないと思います...\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbl-semba-ryuichiro%2Fgithub-review-comments-counter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbl-semba-ryuichiro%2Fgithub-review-comments-counter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbl-semba-ryuichiro%2Fgithub-review-comments-counter/lists"}