@alibaba-group/open-code-review 1.2.4 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,223 @@
1
+ # OpenCodeReview 기여 가이드
2
+
3
+ OpenCodeReview에 기여해 주셔서 감사합니다. 오타 수정, bug report, 새 기능 구현 등 모든 기여는 프로젝트에 도움이 됩니다.
4
+
5
+ [English](CONTRIBUTING.md) | [简体中文版](CONTRIBUTING.zh-CN.md) | [日本語版](CONTRIBUTING.ja-JP.md) | 한국어
6
+
7
+ ## Code of Conduct
8
+
9
+ 이 프로젝트에 참여하는 모든 사람은 서로를 존중하고 포용적인 환경을 유지해야 합니다. 모든 interaction에서 친절하고 건설적인 태도를 유지해 주세요.
10
+
11
+ ## 기여 방법
12
+
13
+ 코드 작성 외에도 여러 방식으로 기여할 수 있습니다.
14
+
15
+ - **Bug report**: 문제가 있으면 재현 단계와 함께 issue를 열어 주세요.
16
+ - **Feature 제안**: 개선 아이디어가 있다면 [GitHub Discussions](https://github.com/alibaba/open-code-review/discussions/categories/ideas)에서 논의를 시작하거나 [Feature Request](https://github.com/alibaba/open-code-review/issues/new?template=feature_request.yml) issue를 열 수 있습니다.
17
+ - **문서 개선**: 오타 수정, 설명 보완, 예시 추가를 환영합니다. 문서 문제를 보고하려면 [Documentation Issue](https://github.com/alibaba/open-code-review/issues/new?template=docs_report.yml)를 열어 주세요.
18
+ - **Pull request 리뷰**: 다른 contributor의 코드를 리뷰하는 것도 큰 도움이 됩니다.
19
+ - **코드 작성**: bug fix, feature 추가, performance 개선 등을 기여할 수 있습니다.
20
+
21
+ ## 시작하기
22
+
23
+ ### 전제 조건
24
+
25
+ - [Go 1.25+](https://go.dev/dl/)
26
+ - [Git](https://git-scm.com/)
27
+ - [Make](https://www.gnu.org/software/make/)
28
+
29
+ ### Setup
30
+
31
+ ```bash
32
+ # 1. GitHub에서 repository를 fork합니다
33
+
34
+ # 2. fork를 clone합니다
35
+ git clone https://github.com/<your-username>/open-code-review.git
36
+ cd open-code-review
37
+
38
+ # 3. main repo에서 update를 가져오기 위해 upstream remote를 추가합니다
39
+ git remote add upstream https://github.com/alibaba/open-code-review.git
40
+
41
+ # 4. project를 build합니다
42
+ make build
43
+
44
+ # 5. test를 실행합니다
45
+ make test
46
+ ```
47
+
48
+ 모든 과정이 통과하면 기여를 시작할 준비가 된 것입니다.
49
+
50
+ > **참고:** `upstream` remote는 contributor에게 read-only입니다. main repository의 최신 변경을 가져오는 데 사용하며 직접 push할 수 없습니다. 모든 기여는 fork(`origin`)에 push한 뒤 Pull Request로 제출해야 합니다.
51
+
52
+ ## 개발 workflow
53
+
54
+ ### Branching
55
+
56
+ `main`에서 feature branch를 만듭니다.
57
+
58
+ ```bash
59
+ git checkout main
60
+ git pull upstream main
61
+ git checkout -b feat/your-feature-name
62
+ ```
63
+
64
+ 변경 유형을 나타내기 위해 prefix를 사용합니다.
65
+
66
+ | Prefix | Purpose |
67
+ |--------|---------|
68
+ | `feat/` | 새 기능 |
69
+ | `fix/` | bug fix |
70
+ | `docs/` | 문서 변경만 포함 |
71
+ | `refactor/` | 동작 변화 없는 code refactoring |
72
+ | `test/` | test 추가 또는 수정 |
73
+ | `chore/` | build, CI, tooling 변경 |
74
+
75
+ ### Commit Messages
76
+
77
+ [Conventional Commits](https://www.conventionalcommits.org/) 형식을 따릅니다.
78
+
79
+ ```text
80
+ <type>(<scope>): <short summary>
81
+
82
+ [optional body]
83
+ ```
84
+
85
+ 예시:
86
+
87
+ ```text
88
+ feat(agent): add support for custom tool definitions
89
+ fix(llm): handle timeout errors in Anthropic API calls
90
+ docs(README): update configuration examples
91
+ ```
92
+
93
+ ### Code Quality
94
+
95
+ 변경을 제출하기 전에 모든 check가 통과하는지 확인하세요.
96
+
97
+ ```bash
98
+ # Format and lint (Go standard tooling)
99
+ go fmt ./...
100
+ go vet ./...
101
+
102
+ # race detection과 함께 test 실행
103
+ make test
104
+
105
+ # build 성공 확인
106
+ make build
107
+ ```
108
+
109
+ ### Project Structure
110
+
111
+ ```text
112
+ .
113
+ ├── cmd/opencodereview/ # CLI entry point
114
+ ├── internal/
115
+ │ ├── agent/ # Review agent logic
116
+ │ ├── config/ # Configuration management
117
+ │ ├── diff/ # Git diff parsing
118
+ │ ├── llm/ # LLM API client (Anthropic & OpenAI)
119
+ │ ├── model/ # Data models
120
+ │ ├── session/ # Review session management
121
+ │ ├── tool/ # Built-in tools (file_read, code_search, etc.)
122
+ │ ├── telemetry/ # OpenTelemetry integration
123
+ │ └── viewer/ # WebUI session viewer
124
+ ├── pages/ # WebUI frontend
125
+ ├── scripts/ # Build & install scripts
126
+ └── bin/ # NPM wrapper
127
+ ```
128
+
129
+ ## 문서 기여
130
+
131
+ 문서는 OpenCodeReview의 중요한 일부입니다. README, inline code comment, configuration example, 사용자에게 노출되는 모든 text의 개선을 환영합니다.
132
+
133
+ ### 문서 기여에 해당하는 작업
134
+
135
+ - 오타, 문법 오류, 깨진 link 수정
136
+ - 혼란스러운 설명을 명확히 하거나 빠진 맥락 추가
137
+ - command나 configuration option의 사용 예시 추가
138
+ - feature 변경 이후 오래된 내용 update
139
+ - 지역화 문서 번역 또는 개선(`README.zh-CN.md`, `README.ja-JP.md`, `README.ko-KR.md`, `CONTRIBUTING.zh-CN.md`, `CONTRIBUTING.ja-JP.md`, `CONTRIBUTING.ko-KR.md`)
140
+
141
+ ### 문서 workflow
142
+
143
+ 1. 문제를 발견했지만 직접 수정할 계획이 없다면 [Documentation Issue](https://github.com/alibaba/open-code-review/issues/new?template=docs_report.yml)를 열어 주세요.
144
+ 2. 직접 수정하려면 repo를 fork하고 변경한 뒤 `docs/` branch prefix로 PR을 제출하세요. 예: `docs/fix-config-example`.
145
+ 3. 문서만 변경하는 PR은 test 변경이 필요하지 않지만, 포함한 command와 code snippet이 정확한지 확인해 주세요.
146
+
147
+ ### 문서 파일
148
+
149
+ | File | Purpose |
150
+ |------|---------|
151
+ | `README.md` | main project documentation (English) |
152
+ | `README.zh-CN.md` | Chinese translation |
153
+ | `README.ja-JP.md` | Japanese translation |
154
+ | `README.ko-KR.md` | Korean translation |
155
+ | `CONTRIBUTING.md` | contribution guide (English) |
156
+ | `CONTRIBUTING.zh-CN.md` | contribution guide (Chinese) |
157
+ | `CONTRIBUTING.ja-JP.md` | contribution guide (Japanese) |
158
+ | `CONTRIBUTING.ko-KR.md` | contribution guide (Korean) |
159
+
160
+ ## 변경 제출
161
+
162
+ ### Issue 열기
163
+
164
+ 큰 변경을 시작하기 전에는 먼저 issue를 열어 접근 방식을 논의해 주세요. 이렇게 하면 중복 작업을 줄이고 기여 방향이 프로젝트와 맞는지 확인할 수 있습니다.
165
+
166
+ Bug를 보고할 때는 다음 정보를 포함해 주세요.
167
+
168
+ 1. OpenCodeReview version(`ocr version`)
169
+ 2. OS와 architecture
170
+ 3. 재현 단계
171
+ 4. 기대 동작과 실제 동작
172
+ 5. 관련 log 또는 error message
173
+
174
+ ### Pull Request 절차
175
+
176
+ 1. **PR을 focused하게 유지**: 하나의 PR에는 하나의 논리적 변경만 포함하세요. 서로 독립적인 변경이 여러 개라면 별도 PR로 제출하세요.
177
+ 2. **Test 작성**: 동작 변경에는 test를 추가하거나 update하세요.
178
+ 3. **문서 update**: 사용자에게 보이는 동작이 바뀌면 관련 문서를 update하세요.
179
+ 4. **CLA 서명**: 모든 contributor는 PR이 merge되기 전에 Contributor License Agreement에 서명해야 합니다.
180
+ 5. **PR template 작성**: 변경 내용과 이유를 설명하세요.
181
+
182
+ ### PR title format
183
+
184
+ commit message와 같은 Conventional Commits 형식을 사용합니다.
185
+
186
+ ```text
187
+ feat(agent): add support for custom tool definitions
188
+ ```
189
+
190
+ ### Review process
191
+
192
+ - maintainer가 보통 며칠 내에 PR을 리뷰합니다.
193
+ - 변경 요청이 있을 수 있습니다. 이는 일반적이고 협업적인 과정입니다.
194
+ - 승인되면 maintainer가 PR을 merge합니다.
195
+
196
+ ## Contributor License Agreement (CLA)
197
+
198
+ 모든 contributor는 Alibaba Open Source Contributor License Agreement에 서명해야 합니다. 이는 프로젝트가 license terms에 따라 배포될 수 있도록 하기 위한 절차입니다.
199
+
200
+ 첫 PR을 열면 CLA bot이 안내 comment를 남깁니다. link를 따라 전자 서명하면 되며 보통 1분 정도면 끝납니다.
201
+
202
+ ## 처음 기여하는 분들
203
+
204
+ 처음이라면 다음 label이 붙은 issue를 찾아보세요.
205
+
206
+ - [`good first issue`](https://github.com/alibaba/open-code-review/labels/good%20first%20issue): 시작하기 좋은 작고 범위가 명확한 task
207
+ - [`help wanted`](https://github.com/alibaba/open-code-review/labels/help%20wanted): community help를 환영하는 issue
208
+
209
+ 시작하기 좋은 영역:
210
+
211
+ - error message와 CLI output 개선
212
+ - test가 부족한 code path의 test 작성
213
+ - 문서 개선
214
+
215
+ ## Community
216
+
217
+ - **Bug Reports**: [GitHub Issues](https://github.com/alibaba/open-code-review/issues)
218
+ - **Feature Suggestions**: [GitHub Discussions (Ideas)](https://github.com/alibaba/open-code-review/discussions/categories/ideas) 또는 [Feature Request Issue](https://github.com/alibaba/open-code-review/issues/new?template=feature_request.yml)
219
+ - **Questions & Help**: OpenCodeReview 사용과 관련한 질문은 [GitHub Discussions](https://github.com/alibaba/open-code-review/discussions)에 올릴 수 있습니다.
220
+
221
+ ## License
222
+
223
+ OpenCodeReview에 기여하면 해당 기여가 [Apache License 2.0](LICENSE)에 따라 license되는 것에 동의하는 것입니다.
package/CONTRIBUTING.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Thank you for your interest in contributing to OpenCodeReview! Every contribution matters — whether it's fixing a typo, reporting a bug, or implementing a new feature.
4
4
 
5
- [简体中文版](CONTRIBUTING.zh-CN.md) | [日本語版](CONTRIBUTING.ja-JP.md)
5
+ [简体中文版](CONTRIBUTING.zh-CN.md) | [日本語版](CONTRIBUTING.ja-JP.md) | [한국어](CONTRIBUTING.ko-KR.md)
6
6
 
7
7
  ## Code of Conduct
8
8
 
@@ -135,7 +135,7 @@ Documentation is a crucial part of OpenCodeReview. We welcome improvements to RE
135
135
  - Clarifying confusing explanations or adding missing context
136
136
  - Adding usage examples for commands or configuration options
137
137
  - Updating outdated content (e.g., after a feature change)
138
- - Translating or improving the Chinese documentation (`README.zh-CN.md`, `CONTRIBUTING.zh-CN.md`)
138
+ - Translating or improving localized documentation (`README.zh-CN.md`, `README.ja-JP.md`, `README.ko-KR.md`, `CONTRIBUTING.zh-CN.md`, `CONTRIBUTING.ja-JP.md`, `CONTRIBUTING.ko-KR.md`)
139
139
 
140
140
  ### Documentation Workflow
141
141
 
@@ -149,8 +149,12 @@ Documentation is a crucial part of OpenCodeReview. We welcome improvements to RE
149
149
  | ----------------------- | ------------------------------------ |
150
150
  | `README.md` | Main project documentation (English) |
151
151
  | `README.zh-CN.md` | Chinese translation |
152
+ | `README.ja-JP.md` | Japanese translation |
153
+ | `README.ko-KR.md` | Korean translation |
152
154
  | `CONTRIBUTING.md` | Contribution guide (English) |
153
155
  | `CONTRIBUTING.zh-CN.md` | Contribution guide (Chinese) |
156
+ | `CONTRIBUTING.ja-JP.md` | Contribution guide (Japanese) |
157
+ | `CONTRIBUTING.ko-KR.md` | Contribution guide (Korean) |
154
158
 
155
159
  ## Submitting Changes
156
160
 
package/README.ja-JP.md CHANGED
@@ -7,10 +7,11 @@
7
7
  <p align="center">
8
8
  <a href="https://www.npmjs.com/package/@alibaba-group/open-code-review"><img alt="npm" src="https://img.shields.io/npm/v/@alibaba-group/open-code-review?style=flat-square" /></a>
9
9
  <a href="https://github.com/alibaba/open-code-review/actions/workflows/release.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/alibaba/open-code-review/release.yml?style=flat-square" /></a>
10
+ <a href="https://goreportcard.com/report/github.com/alibaba/open-code-review"><img alt="Go Report Card" src="https://goreportcard.com/badge/github.com/alibaba/open-code-review?style=flat-square" /></a>
10
11
  <a href="https://github.com/alibaba/open-code-review/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/github/license/alibaba/open-code-review?style=flat-square" /></a>
11
12
  </p>
12
13
  <p align="center">
13
- <a href="README.md">English</a> | <a href="README.zh-CN.md">简体中文</a> | 日本語
14
+ <a href="README.md">English</a> | <a href="README.zh-CN.md">简体中文</a> | 日本語 | <a href="README.ko-KR.md">한국어</a>
14
15
  </p>
15
16
 
16
17
  ---
@@ -128,11 +129,21 @@ export OCR_USE_ANTHROPIC=true
128
129
 
129
130
  設定は`~/.opencodereview/config.json`に保存されます。
130
131
 
132
+ **`auth_header`(オプション):** Anthropic使用時にAPIキーを送信するHTTPヘッダーを制御します。省略時のデフォルトは`authorization`(Bearerトークン)です。標準の`sk-ant-*` APIキーを使用する場合は、`x-api-key`に設定する必要があります:
133
+
134
+ ```bash
135
+ ocr config set llm.auth_header x-api-key
136
+ # または
137
+ export OCR_LLM_AUTH_HEADER=x-api-key
138
+ ```
139
+
140
+ サポートされる値:`x-api-key`、`authorization`(エイリアス:`bearer`)。それ以外の値はエラーになります。
141
+
131
142
  また、Claude Codeの環境変数(`ANTHROPIC_BASE_URL`、`ANTHROPIC_AUTH_TOKEN`、`ANTHROPIC_MODEL`)とも互換性があり、`~/.zshrc` / `~/.bashrc`からこれらのexportをパースします。
132
143
 
133
144
  > **CC-Switchユーザー向けの注意**: [CC-Switch](https://github.com/farion1231/cc-switch)を[ルーティングサービス](https://www.ccswitch.io/en/docs?section=proxy&item=service)有効で使用している場合、追加設定なしで`llm.url`をCC-Switchのプロキシアドレスに向けることができます:
134
145
  > - **Claude**プロバイダーの場合: `llm.url`を`http://127.0.0.1:15721`に設定
135
- > - **CodeX**プロバイダーの場合: `llm.url`を`http://127.0.0.1:15721/v1`に設定
146
+ > - **Codex**プロバイダーの場合: `llm.url`を`http://127.0.0.1:15721/v1`に設定
136
147
  > - `llm.model`はプロバイダー設定に応じて設定
137
148
  > - `llm.auth_token`は任意の値で構いません
138
149
  > - `extra_body`設定は引き続き有効です
@@ -183,7 +194,43 @@ npx skills add alibaba/open-code-review --skill open-code-review
183
194
 
184
195
  これにより`/open-code-review:review`スラッシュコマンドが登録され、OCRを実行して問題を自動的にフィルタリング・修正します。
185
196
 
186
- #### オプション3: コマンドファイルを直接コピー
197
+ #### オプション3: Codexプラグインとしてインストール
198
+
199
+ ローカルCodexでは、このリポジトリからOpen Code Reviewプラグインをインストールできます:
200
+
201
+ ```bash
202
+ codex plugin marketplace add alibaba/open-code-review
203
+ codex
204
+ /plugins
205
+ ```
206
+
207
+ ローカルcheckoutまたはforkでは、次を使用できます:
208
+
209
+ ```bash
210
+ codex plugin marketplace add .
211
+ codex
212
+ /plugins
213
+ ```
214
+
215
+ `Open Code Review`をインストールして有効化した後、新しいCodex threadを開始して明示的に呼び出します:
216
+
217
+ ```text
218
+ @Open Code Review review my current changes
219
+ @Open Code Review review this branch against main
220
+ @Open Code Review review and fix high-confidence issues
221
+ ```
222
+
223
+ これにより、ローカルOCR CLIを実行するCodex skillが登録されます:
224
+
225
+ ```bash
226
+ ocr review --audience agent
227
+ ```
228
+
229
+ この統合はOCRの内部LLM backendを変更せず、Codex用のOpenAI Responses API endpoint設定も必要ありません。OCR自体には、CLI setupセクションで説明されている`ocr` CLIのインストールと設定が引き続き必要です。
230
+
231
+ 韓国語ガイド:[`plugins/open-code-review/CODEX.ko-KR.md`](plugins/open-code-review/CODEX.ko-KR.md)
232
+
233
+ #### オプション4: コマンドファイルを直接コピー
187
234
 
188
235
  パッケージマネージャーを使わずに素早くセットアップしたい場合は、コマンドファイルをコピーするだけでClaude Codeで`/open-code-review`スラッシュコマンドを使えるようになります。
189
236
 
@@ -326,6 +373,48 @@ OCRは4層の優先度チェーンを使ってレビュールールを解決し
326
373
  - 各層の中では、ルールは宣言順に評価されます — 最初にマッチしたものが採用されます。
327
374
  - ルールファイルが存在しない場合は、何も出力せずスキップされます。
328
375
 
376
+ ### パスフィルタリング
377
+
378
+ ルールファイルでは `include` と `exclude` フィールドも使用でき、どのファイルをレビュー対象にするかを制御できます:
379
+
380
+ ```json
381
+ {
382
+ "rules": [
383
+ {"path": "**/*.java", "rule": "null安全性をチェック"}
384
+ ],
385
+ "include": ["src/main/**/*.java", "lib/**/*.kt"],
386
+ "exclude": ["**/generated/**", "vendor/**"]
387
+ }
388
+ ```
389
+
390
+ **フィルタ判定の優先度(高い順):**
391
+
392
+ | ステップ | 条件 | 結果 |
393
+ |------|-----------|--------|
394
+ | 1 | ファイルがバイナリ | 除外 |
395
+ | 2 | パスがユーザーの`exclude`パターンにマッチ | 除外 |
396
+ | 3 | ファイル拡張子がサポートリストにない | 除外 |
397
+ | 4 | `include`が設定されており、パスがマッチ | **レビュー対象**(ステップ5をスキップ) |
398
+ | 5 | パスが組み込みデフォルト除外パターン(テストファイル等)にマッチ | 除外 |
399
+ | 6 | 上記のいずれにも該当しない | レビュー対象 |
400
+
401
+ **動作ロジック:**
402
+
403
+ - `include`と`exclude`はレビュールールと同じ優先度チェーン(`--rule` > プロジェクト設定 > グローバル設定)に従います。**include/excludeが設定されている最も高い優先度の層**が一括で適用され、層を跨いだマージは行われません。
404
+ - `exclude`は常に`include`より優先されます — 両方にマッチするファイルは除外されます。
405
+ - `include`は**組み込みデフォルト除外パターンをバイパスする**ためのものであり(例:テストファイル)、排他的な許可リストではありません — `include`パターンにマッチしないファイルも通常通りデフォルトフィルタチェックに進みます。
406
+ - パターン構文:`**`再帰マッチ、`*`単一セグメントマッチ、`{a,b}`ブレース展開をサポート。マッチングは大文字小文字を区別しません。
407
+
408
+ **組み込みデフォルト除外パターン**(テストファイル等をフィルタ — `include`でオーバーライド可能):
409
+
410
+ ```
411
+ **/*_test.go, **/*Test.java, **/*Tests.java, **/*_test.rs,
412
+ **/*.test.{js,jsx,ts,tsx}, **/*.spec.{js,jsx,ts,tsx}, **/__tests__/**,
413
+ **/src/test/java/**/*.java, **/src/test/**/*.kt,
414
+ **/test/**/*_test.py, **/tests/**/*_test.py, **/*_test.py,
415
+ **/*_spec.rb, **/spec/**/*_spec.rb, **/oh_modules/**
416
+ ```
417
+
329
418
  ## 設定リファレンス
330
419
 
331
420
  設定ファイル:`~/.opencodereview/config.json`
@@ -334,6 +423,7 @@ OCRは4層の優先度チェーンを使ってレビュールールを解決し
334
423
  |-----|------|---------|
335
424
  | `llm.url` | string | `https://api.openai.com/v1/chat/completions` |
336
425
  | `llm.auth_token` | string | `sk-xxxxxxx` |
426
+ | `llm.auth_header` | string | Anthropicのみ:`x-api-key` \| `authorization` |
337
427
  | `llm.model` | string | `claude-opus-4-6` |
338
428
  | `llm.use_anthropic` | boolean | `true` \| `false` |
339
429
  | `language` | string | `English` \| `Chinese`(デフォルト:Chinese) |
@@ -350,6 +440,7 @@ OCRは4層の優先度チェーンを使ってレビュールールを解決し
350
440
  |----------|---------|
351
441
  | `OCR_LLM_URL` | LLM APIエンドポイントURL |
352
442
  | `OCR_LLM_TOKEN` | APIキー / 認証トークン |
443
+ | `OCR_LLM_AUTH_HEADER` | Anthropic認証ヘッダー(`x-api-key`または`authorization`) |
353
444
  | `OCR_LLM_MODEL` | モデル名 |
354
445
  | `OCR_USE_ANTHROPIC` | `true` = Anthropic、`false` = OpenAI |
355
446