glreview 0.1.0__py3-none-any.whl

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,177 @@
1
+ You are an expert code reviewer for scientific software. Your task is to review the following Python module thoroughly and provide actionable feedback.
2
+
3
+ ## Context
4
+
5
+ **Module:** `{{ path }}`
6
+ **Lines:** {{ lines }}
7
+ **Priority:** {{ priority }} ({{ priority_description }})
8
+ {% if is_rereview %}
9
+ **Review Type:** Re-review (code changed since last review)
10
+ **Previous Review:** {{ previous_commit }} ({{ previous_date }})
11
+ **Previous Reviewers:** {{ previous_reviewers }}
12
+ {% else %}
13
+ **Review Type:** Initial review (first formal review of this module)
14
+ {% endif %}
15
+
16
+ ## Module Contents
17
+
18
+ {{ module_contents }}
19
+
20
+ {% if diff %}
21
+ ## Changes Since Last Review
22
+
23
+ The following diff shows what changed since the last review:
24
+
25
+ ```diff
26
+ {{ diff }}
27
+ ```
28
+
29
+ Focus your review on these changes, but also note any issues in unchanged code that may have been missed previously.
30
+ {% endif %}
31
+
32
+ ## Source Code
33
+
34
+ ```python
35
+ {{ source_code }}
36
+ ```
37
+
38
+ ## Review Instructions
39
+
40
+ Please review this code against the following criteria. For each item:
41
+ - Mark as **PASS** if the code meets the criterion
42
+ - Mark as **WARN** if there's a potential issue or improvement opportunity
43
+ - Mark as **FAIL** if there's a clear problem that should be fixed
44
+
45
+ Always include specific line numbers and code references for any WARN or FAIL items.
46
+
47
+ ### 1. Correctness
48
+
49
+ 1.1. **Algorithm Implementation**
50
+ - Does the code correctly implement its intended algorithm/logic?
51
+ - Are there any off-by-one errors, incorrect conditions, or logic flaws?
52
+
53
+ 1.2. **Edge Cases**
54
+ - Are edge cases handled? (empty inputs, None values, boundary conditions)
55
+ - What happens with unexpected input types or values?
56
+
57
+ 1.3. **Error Handling**
58
+ - Are errors caught and handled appropriately?
59
+ - Are error messages clear and actionable?
60
+ - Are exceptions too broad (bare `except:`) or too narrow?
61
+
62
+ ### 2. Scientific Rigor
63
+
64
+ 2.1. **Numerical Stability**
65
+ - Are there potential overflow/underflow issues?
66
+ - Is floating-point comparison done safely (not with `==`)?
67
+ - Are there division-by-zero risks?
68
+
69
+ 2.2. **Units and Dimensions**
70
+ - Are physical units consistent throughout?
71
+ - Are conversions done correctly?
72
+ - Are dimensionless quantities clearly identified?
73
+
74
+ 2.3. **Algorithm Validity**
75
+ - Does the implementation match established scientific methods?
76
+ - Are any approximations or assumptions documented?
77
+ - Are numerical methods appropriate for the problem?
78
+
79
+ ### 3. Robustness
80
+
81
+ 3.1. **Input Validation**
82
+ - Are inputs validated at module boundaries?
83
+ - Are preconditions checked and documented?
84
+
85
+ 3.2. **Resource Management**
86
+ - Are files, connections, and resources properly closed?
87
+ - Is memory usage reasonable for expected data sizes?
88
+
89
+ 3.3. **Concurrency Safety** (if applicable)
90
+ - Are shared resources protected?
91
+ - Are there potential race conditions?
92
+
93
+ ### 4. Maintainability
94
+
95
+ 4.1. **Code Clarity**
96
+ - Is the code readable without excessive comments?
97
+ - Are variable/function names descriptive?
98
+ - Is the code structure logical?
99
+
100
+ 4.2. **Documentation**
101
+ - Do public functions have docstrings?
102
+ - Are complex algorithms explained?
103
+ - Are any "magic numbers" explained?
104
+
105
+ 4.3. **Complexity**
106
+ - Are functions reasonably sized (< 50 lines preferred)?
107
+ - Is cyclomatic complexity manageable?
108
+ - Could any code be simplified?
109
+
110
+ ## Output Format
111
+
112
+ Please structure your response as follows:
113
+
114
+ ```markdown
115
+ ## Review Summary
116
+
117
+ **Overall Assessment:** [PASS | NEEDS_WORK | SIGNIFICANT_ISSUES]
118
+
119
+ **Key Findings:**
120
+ - [1-3 sentence summary of most important findings]
121
+
122
+ ## Detailed Findings
123
+
124
+ ### Correctness
125
+
126
+ #### 1.1 Algorithm Implementation: [PASS|WARN|FAIL]
127
+ [Your assessment with specific line references if WARN/FAIL]
128
+
129
+ #### 1.2 Edge Cases: [PASS|WARN|FAIL]
130
+ [Your assessment]
131
+
132
+ #### 1.3 Error Handling: [PASS|WARN|FAIL]
133
+ [Your assessment]
134
+
135
+ ### Scientific Rigor
136
+
137
+ #### 2.1 Numerical Stability: [PASS|WARN|FAIL]
138
+ [Your assessment]
139
+
140
+ #### 2.2 Units and Dimensions: [PASS|WARN|FAIL]
141
+ [Your assessment]
142
+
143
+ #### 2.3 Algorithm Validity: [PASS|WARN|FAIL]
144
+ [Your assessment]
145
+
146
+ ### Robustness
147
+
148
+ #### 3.1 Input Validation: [PASS|WARN|FAIL]
149
+ [Your assessment]
150
+
151
+ #### 3.2 Resource Management: [PASS|WARN|FAIL]
152
+ [Your assessment]
153
+
154
+ #### 3.3 Concurrency Safety: [PASS|WARN|FAIL|N/A]
155
+ [Your assessment]
156
+
157
+ ### Maintainability
158
+
159
+ #### 4.1 Code Clarity: [PASS|WARN|FAIL]
160
+ [Your assessment]
161
+
162
+ #### 4.2 Documentation: [PASS|WARN|FAIL]
163
+ [Your assessment]
164
+
165
+ #### 4.3 Complexity: [PASS|WARN|FAIL]
166
+ [Your assessment]
167
+
168
+ ## Recommendations
169
+
170
+ [Prioritized list of recommended changes, if any]
171
+
172
+ ## Questions for Author
173
+
174
+ [Any clarifying questions about intent or design decisions]
175
+ ```
176
+
177
+ Be thorough but concise. Focus on issues that matter for correctness and scientific validity. Minor style issues are lower priority than functional concerns.
@@ -0,0 +1,61 @@
1
+ ## Module: `{{ path }}`
2
+
3
+ **Lines:** {{ lines }}
4
+ **Priority:** {{ priority }}
5
+ **Reviewers required:** {{ reviewers_required }}
6
+
7
+ ### Module Contents
8
+ {{ module_contents }}
9
+
10
+ {% if previous_commit %}
11
+ ### Changes Since Last Review
12
+
13
+ **Previous review:** {{ previous_commit }} ({{ previous_date }})
14
+ **Current HEAD:** {{ current_commit }}
15
+
16
+ [View diff]({{ diff_url }})
17
+
18
+ **Previous reviewers:** {{ previous_reviewers }}
19
+ {% else %}
20
+ ### First Review
21
+
22
+ This module has not been formally reviewed before.
23
+
24
+ **Current HEAD:** {{ current_commit }}
25
+ {% endif %}
26
+
27
+ ---
28
+
29
+ ## Review Checklist
30
+
31
+ ### Correctness
32
+ - [ ] Algorithm correctly implements intended logic
33
+ - [ ] Edge cases handled (empty input, boundaries, None)
34
+ - [ ] Error handling is appropriate and messages are clear
35
+
36
+ ### Scientific Rigor
37
+ - [ ] Numerical operations are stable (no overflow/division-by-zero)
38
+ - [ ] Units and dimensions are consistent
39
+ - [ ] Implementation matches established methods
40
+
41
+ ### Robustness
42
+ - [ ] Inputs validated at module boundaries
43
+ - [ ] Resources properly managed (files closed, memory reasonable)
44
+
45
+ ### Maintainability
46
+ - [ ] Code is readable and well-structured
47
+ - [ ] Public functions have docstrings
48
+ - [ ] No unnecessary complexity
49
+
50
+ ---
51
+
52
+ ## Findings
53
+
54
+ _Add findings below. Use `glreview claude-review {{ path }}` for AI-assisted review._
55
+
56
+ ---
57
+
58
+ When complete, close this issue and run:
59
+ ```
60
+ glreview signoff {{ path }}
61
+ ```
@@ -0,0 +1,211 @@
1
+ Metadata-Version: 2.4
2
+ Name: glreview
3
+ Version: 0.1.0
4
+ Summary: GitLab code review tracking for scientific software
5
+ Author-email: Chad Hanna <chad.hanna@ligo.org>
6
+ License: MIT
7
+ Project-URL: Homepage, https://git.ligo.org/chad.hanna/glreview
8
+ Project-URL: Documentation, https://git.ligo.org/chad.hanna/glreview
9
+ Project-URL: Repository, https://git.ligo.org/chad.hanna/glreview
10
+ Project-URL: Issues, https://git.ligo.org/chad.hanna/glreview/-/issues
11
+ Keywords: gitlab,code-review,scientific-software,ci-cd
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Software Development :: Quality Assurance
23
+ Classifier: Topic :: Software Development :: Version Control :: Git
24
+ Requires-Python: >=3.10
25
+ Description-Content-Type: text/markdown
26
+ Requires-Dist: click>=8.0
27
+ Requires-Dist: jinja2>=3.0
28
+ Requires-Dist: python-gitlab>=4.0
29
+ Requires-Dist: tomli>=2.0; python_version < "3.11"
30
+ Provides-Extra: dev
31
+ Requires-Dist: pytest>=8.0; extra == "dev"
32
+ Requires-Dist: pytest-cov; extra == "dev"
33
+ Requires-Dist: black; extra == "dev"
34
+ Requires-Dist: isort; extra == "dev"
35
+ Requires-Dist: flake8; extra == "dev"
36
+ Requires-Dist: mypy; extra == "dev"
37
+
38
+ # glreview
39
+
40
+ GitLab code review tracking for scientific software.
41
+
42
+ ## Features
43
+
44
+ - **Track review status** of source modules with git commit precision
45
+ - **GitLab integration** - creates issues, verifies completion, closes on cancel
46
+ - **AI-assisted review** - Claude Code integration for automated analysis
47
+ - **Change detection** - warns if code changes during review
48
+ - **Module analysis** - shows classes/functions in review issues
49
+ - **Customizable templates** - Jinja2-based issue templates
50
+ - **CI-friendly** - exit codes for automated checks
51
+ - **Priority rules** - pattern-based priority assignment
52
+
53
+ ## Installation
54
+
55
+ ```bash
56
+ pip install glreview
57
+ ```
58
+
59
+ ## GitLab Authentication
60
+
61
+ For GitLab integration, set an environment variable:
62
+
63
+ ```bash
64
+ export GITLAB_PRIVATE_TOKEN=glpat-xxxxxxxxxxxx
65
+
66
+ # For self-hosted GitLab
67
+ export GITLAB_URL=https://gitlab.example.com
68
+ ```
69
+
70
+ In CI pipelines, `CI_JOB_TOKEN` is used automatically.
71
+
72
+ ## Quick Start
73
+
74
+ ```bash
75
+ # Initialize in your project
76
+ glreview init
77
+
78
+ # Check status
79
+ glreview status
80
+
81
+ # Start a review (creates GitLab issue)
82
+ glreview start src/mymodule/core.py --assignee @reviewer
83
+
84
+ # After review is complete (issue closed)
85
+ glreview signoff src/mymodule/core.py
86
+ ```
87
+
88
+ ## Commands
89
+
90
+ | Command | Description |
91
+ |---------|-------------|
92
+ | `glreview init` | Initialize (idempotent - safe to re-run) |
93
+ | `glreview status` | Show review progress and module status |
94
+ | `glreview start PATH` | Start a review (creates GitLab issue) |
95
+ | `glreview signoff PATH` | Sign off on a completed review |
96
+ | `glreview cancel PATH` | Cancel or restart a review |
97
+ | `glreview claude-review PATH` | Run AI-assisted review with Claude |
98
+ | `glreview report` | Generate coverage report (markdown/json/badge) |
99
+ | `glreview list` | List all modules |
100
+ | `glreview reviewers` | List available reviewers |
101
+ | `glreview check` | CI check for changes |
102
+ | `glreview sync` | Sync registry with filesystem |
103
+ | `glreview ci-config` | Print recommended GitLab CI configuration |
104
+
105
+ ## Review Lifecycle
106
+
107
+ ```
108
+ ┌─────────────┐
109
+ │ needs_review│◄──────────────────┐
110
+ └──────┬──────┘ │
111
+ │ start │ cancel
112
+ ▼ │
113
+ ┌─────────────┐ │
114
+ │ in_progress │───────────────────┤
115
+ └──────┬──────┘ │
116
+ │ signoff │
117
+ ▼ │
118
+ ┌─────────────┐ code changes │
119
+ │ reviewed │───────────────────┘
120
+ └─────────────┘ (re-review)
121
+ ```
122
+
123
+ **Key behaviors:**
124
+ - `signoff` warns if file changed during review (use `--acknowledge` to proceed)
125
+ - `cancel` closes the GitLab issue by default (use `--leave-open` to skip)
126
+ - `cancel --restart` keeps the issue open and updates the start commit
127
+
128
+ ## AI-Assisted Review
129
+
130
+ Use Claude Code for automated code analysis:
131
+
132
+ ```bash
133
+ # Run review (requires claude CLI)
134
+ glreview claude-review src/module.py
135
+
136
+ # Post findings to GitLab issue
137
+ glreview claude-review src/module.py --post
138
+
139
+ # Preview prompt without running
140
+ glreview claude-review src/module.py --dry-run
141
+ ```
142
+
143
+ Reviews check: correctness, scientific rigor, robustness, and maintainability.
144
+ Large files are automatically chunked.
145
+
146
+ ## Configuration
147
+
148
+ Add to `pyproject.toml`:
149
+
150
+ ```toml
151
+ [tool.glreview]
152
+ sources = ["src/**/*.py"]
153
+ exclude = ["**/_version.py", "**/test_*.py"]
154
+
155
+ # Custom issue template (optional)
156
+ issue_template = ".glreview/issue_template.md"
157
+
158
+ # Priority rules (first match wins)
159
+ [[tool.glreview.priority]]
160
+ pattern = "src/**/core.py"
161
+ level = "critical"
162
+ reviewers_required = 2
163
+
164
+ [[tool.glreview.priority]]
165
+ pattern = "src/**/*.py"
166
+ level = "medium"
167
+ reviewers_required = 1
168
+ ```
169
+
170
+ ## CI Integration
171
+
172
+ glreview can automatically sync and report on every push:
173
+
174
+ ```bash
175
+ # Print full CI configuration
176
+ glreview ci-config
177
+ ```
178
+
179
+ **Basic setup** - sync registry and generate coverage on MRs and main:
180
+
181
+ ```yaml
182
+ review-sync:
183
+ script:
184
+ - pip install glreview
185
+ - glreview report --sync --commit -m "chore: update review registry [skip ci]"
186
+ - git push # Push updated registry
187
+ rules:
188
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
189
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
190
+ ```
191
+
192
+ **Release gate** - require 100% coverage for releases:
193
+
194
+ ```yaml
195
+ release-gate:
196
+ script:
197
+ - pip install glreview
198
+ - glreview report --format json | python -c "
199
+ import sys,json
200
+ c = json.load(sys.stdin)['coverage_pct']
201
+ sys.exit(0 if c == 100 else 1)
202
+ "
203
+ rules:
204
+ - if: $CI_COMMIT_TAG
205
+ ```
206
+
207
+ Run `glreview ci-config` for complete configuration with proper git push setup.
208
+
209
+ ## License
210
+
211
+ MIT
@@ -0,0 +1,17 @@
1
+ glreview/__init__.py,sha256=AjkPCqgaHe7zhyK2RFITVfPGRoNJBOZ6BoutL0obrSg,203
2
+ glreview/_version.py,sha256=5jwwVncvCiTnhOedfkzzxmxsggwmTBORdFL_4wq0ZeY,704
3
+ glreview/analyze.py,sha256=jdaSrp4s6FfijMu4BWnn4dSevo4ec1SHFPpBsx8sNkI,5410
4
+ glreview/claude.py,sha256=wXc1Lj7Xto-BZ_c-j1xHv1QzQ5JHYIBbM_b8KC49RVE,7899
5
+ glreview/cli.py,sha256=PUfnJI2-RVOH9OB7_A_Hol0DDjgPWFh8jRe_bpp95Ww,41918
6
+ glreview/config.py,sha256=CXKC10C6I42huDvTt3lO8cMH-Er3KQ_LvIis-Sho1Ag,4180
7
+ glreview/discovery.py,sha256=UwS6EKJRuoPiyU7SFPnHovyY_0qtoK6RsykXWVg3o4c,1910
8
+ glreview/git.py,sha256=Tp4PH7y3dQAcXf7XDIt9nsopQws60WkUh9Hnq-dViSE,5042
9
+ glreview/gitlab.py,sha256=nsINJD3nUAVGYzDEJe7aoe29pegbEVVcTUiXQKeqy6I,9827
10
+ glreview/registry.py,sha256=M2DewdVsqOfvyANaLwKOmN1_1Ex19dFfv587KpmLrNI,5627
11
+ glreview/templates/claude_review_prompt.md,sha256=Knx1PjDX_AJ2Bx6sn0LPZceLDpkrTUSe6IoEaEiNQjo,4666
12
+ glreview/templates/issue.md,sha256=Knd4C1H5maZrwhqNq09Qc2SqZlCc19DEhJzUkzfuVW0,1384
13
+ glreview-0.1.0.dist-info/METADATA,sha256=DEdGeBy5J9c7-it-r1XdZ9EFyAaokS3oHkO-Z2U4v3g,6434
14
+ glreview-0.1.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
15
+ glreview-0.1.0.dist-info/entry_points.txt,sha256=zwZw460cWQv_0xHHqDTgBZ1WHTSbK_rLRT5finu9pJk,47
16
+ glreview-0.1.0.dist-info/top_level.txt,sha256=GyHMzWiMcJcjQ_dfCbIy-yo3exhr2k91NtrTLloTu54,9
17
+ glreview-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.10.2)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ glreview = glreview.cli:main
@@ -0,0 +1 @@
1
+ glreview