commitwise-review 0.1.1__tar.gz → 0.1.3__tar.gz
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.
- {commitwise_review-0.1.1 → commitwise_review-0.1.3}/LICENSE +21 -21
- {commitwise_review-0.1.1 → commitwise_review-0.1.3}/PKG-INFO +91 -90
- {commitwise_review-0.1.1 → commitwise_review-0.1.3}/README.md +79 -79
- {commitwise_review-0.1.1 → commitwise_review-0.1.3}/commitwise_review.egg-info/PKG-INFO +91 -90
- commitwise_review-0.1.3/commitwise_review.egg-info/requires.txt +2 -0
- {commitwise_review-0.1.1 → commitwise_review-0.1.3}/gai/__init__.py +1 -1
- {commitwise_review-0.1.1 → commitwise_review-0.1.3}/gai/__main__.py +4 -4
- {commitwise_review-0.1.1 → commitwise_review-0.1.3}/gai/analyzers/local.py +30 -30
- {commitwise_review-0.1.1 → commitwise_review-0.1.3}/gai/cli/main.py +187 -180
- {commitwise_review-0.1.1 → commitwise_review-0.1.3}/gai/config/settings.py +55 -55
- {commitwise_review-0.1.1 → commitwise_review-0.1.3}/gai/git/staged.py +39 -39
- {commitwise_review-0.1.1 → commitwise_review-0.1.3}/gai/hooks/install.py +16 -16
- {commitwise_review-0.1.1 → commitwise_review-0.1.3}/gai/prompts/review_prompt.py +30 -30
- commitwise_review-0.1.3/gai/providers/reviewer.py +171 -0
- {commitwise_review-0.1.1 → commitwise_review-0.1.3}/pyproject.toml +21 -20
- {commitwise_review-0.1.1 → commitwise_review-0.1.3}/setup.cfg +4 -4
- {commitwise_review-0.1.1 → commitwise_review-0.1.3}/tests/test_cli.py +25 -25
- {commitwise_review-0.1.1 → commitwise_review-0.1.3}/tests/test_hooks.py +23 -23
- {commitwise_review-0.1.1 → commitwise_review-0.1.3}/tests/test_reviewer.py +30 -20
- commitwise_review-0.1.1/commitwise_review.egg-info/requires.txt +0 -1
- commitwise_review-0.1.1/gai/providers/reviewer.py +0 -102
- {commitwise_review-0.1.1 → commitwise_review-0.1.3}/commitwise_review.egg-info/SOURCES.txt +0 -0
- {commitwise_review-0.1.1 → commitwise_review-0.1.3}/commitwise_review.egg-info/dependency_links.txt +0 -0
- {commitwise_review-0.1.1 → commitwise_review-0.1.3}/commitwise_review.egg-info/entry_points.txt +0 -0
- {commitwise_review-0.1.1 → commitwise_review-0.1.3}/commitwise_review.egg-info/top_level.txt +0 -0
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Gokulakrishnan M
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Gokulakrishnan M
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,90 +1,91 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: commitwise-review
|
|
3
|
-
Version: 0.1.
|
|
4
|
-
Summary: Git staged-change AI review helper
|
|
5
|
-
Author: Gokulakrishnan
|
|
6
|
-
Requires-Python: >=3.11
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
License-File: LICENSE
|
|
9
|
-
Requires-Dist: keyring
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
- `0.
|
|
54
|
-
- `0.2.
|
|
55
|
-
- `
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
commit-wise
|
|
66
|
-
commit-wise
|
|
67
|
-
commit-wise
|
|
68
|
-
commit-wise
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
gai
|
|
76
|
-
gai
|
|
77
|
-
gai
|
|
78
|
-
gai
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
- Reads staged
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: commitwise-review
|
|
3
|
+
Version: 0.1.3
|
|
4
|
+
Summary: Git staged-change AI review helper
|
|
5
|
+
Author: Gokulakrishnan
|
|
6
|
+
Requires-Python: >=3.11
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Dist: keyring
|
|
10
|
+
Requires-Dist: azure-ai-inference
|
|
11
|
+
Dynamic: license-file
|
|
12
|
+
|
|
13
|
+
# Commit-wise
|
|
14
|
+
|
|
15
|
+
Open Source Commit and PR reviewer.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
Install the library from PyPI:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install commitwise-review
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Install directly from the source repository:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install .
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Install from GitHub:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install git+https://github.com/gokul-1998/Commit-wise.git
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
To force reinstall:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pip install --force-reinstall --no-cache-dir git+https://github.com/gokul-1998/Commit-wise.git
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Versioning
|
|
44
|
+
|
|
45
|
+
This project uses Semantic Versioning:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
MAJOR.MINOR.PATCH
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Example release plan:
|
|
52
|
+
|
|
53
|
+
- `0.1.0` — initial release
|
|
54
|
+
- `0.2.0` — new features
|
|
55
|
+
- `0.2.1` — bug fixes and prompt improvements
|
|
56
|
+
- `1.0.0` — stable public release
|
|
57
|
+
|
|
58
|
+
## CLI MVP (`commit-wise`)
|
|
59
|
+
|
|
60
|
+
This repository now includes a minimal local CLI for staged-change review.
|
|
61
|
+
|
|
62
|
+
### Commands
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
commit-wise init
|
|
66
|
+
commit-wise review
|
|
67
|
+
commit-wise explain
|
|
68
|
+
commit-wise commit
|
|
69
|
+
commit-wise hooks install
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The old `gai` alias is still available:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
gai init
|
|
76
|
+
gai review
|
|
77
|
+
gai explain
|
|
78
|
+
gai commit
|
|
79
|
+
gai hooks install
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### What `commit-wise review` does
|
|
83
|
+
|
|
84
|
+
- Reads staged files from `git diff --cached --name-only`
|
|
85
|
+
- Reads staged diff from `git diff --cached`
|
|
86
|
+
- Runs local analyzers when installed (`ruff`, `mypy`, `pytest`, `bandit`)
|
|
87
|
+
- Prints actionable review suggestions and score in terminal
|
|
88
|
+
|
|
89
|
+
### Security
|
|
90
|
+
|
|
91
|
+
`gai init` stores provider tokens in the system keyring (`keyring` package), not in plain-text config.
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
# Commit-wise
|
|
2
|
-
|
|
3
|
-
Open Source Commit and PR reviewer.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
Install the library from PyPI:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
pip install commitwise-review
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Install directly from the source repository:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
pip install .
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Install from GitHub:
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
pip install git+https://github.com/gokul-1998/Commit-wise.git
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
To force reinstall:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
pip install --force-reinstall --no-cache-dir git+https://github.com/gokul-1998/Commit-wise.git
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Versioning
|
|
32
|
-
|
|
33
|
-
This project uses Semantic Versioning:
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
MAJOR.MINOR.PATCH
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
Example release plan:
|
|
40
|
-
|
|
41
|
-
- `0.1.0` — initial release
|
|
42
|
-
- `0.2.0` — new features
|
|
43
|
-
- `0.2.1` — bug fixes and prompt improvements
|
|
44
|
-
- `1.0.0` — stable public release
|
|
45
|
-
|
|
46
|
-
## CLI MVP (`commit-wise`)
|
|
47
|
-
|
|
48
|
-
This repository now includes a minimal local CLI for staged-change review.
|
|
49
|
-
|
|
50
|
-
### Commands
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
commit-wise init
|
|
54
|
-
commit-wise review
|
|
55
|
-
commit-wise explain
|
|
56
|
-
commit-wise commit
|
|
57
|
-
commit-wise hooks install
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
The old `gai` alias is still available:
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
gai init
|
|
64
|
-
gai review
|
|
65
|
-
gai explain
|
|
66
|
-
gai commit
|
|
67
|
-
gai hooks install
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### What `commit-wise review` does
|
|
71
|
-
|
|
72
|
-
- Reads staged files from `git diff --cached --name-only`
|
|
73
|
-
- Reads staged diff from `git diff --cached`
|
|
74
|
-
- Runs local analyzers when installed (`ruff`, `mypy`, `pytest`, `bandit`)
|
|
75
|
-
- Prints actionable review suggestions and score in terminal
|
|
76
|
-
|
|
77
|
-
### Security
|
|
78
|
-
|
|
79
|
-
`gai init` stores provider tokens in the system keyring (`keyring` package), not in plain-text config.
|
|
1
|
+
# Commit-wise
|
|
2
|
+
|
|
3
|
+
Open Source Commit and PR reviewer.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
Install the library from PyPI:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install commitwise-review
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Install directly from the source repository:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install .
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Install from GitHub:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install git+https://github.com/gokul-1998/Commit-wise.git
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
To force reinstall:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install --force-reinstall --no-cache-dir git+https://github.com/gokul-1998/Commit-wise.git
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Versioning
|
|
32
|
+
|
|
33
|
+
This project uses Semantic Versioning:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
MAJOR.MINOR.PATCH
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Example release plan:
|
|
40
|
+
|
|
41
|
+
- `0.1.0` — initial release
|
|
42
|
+
- `0.2.0` — new features
|
|
43
|
+
- `0.2.1` — bug fixes and prompt improvements
|
|
44
|
+
- `1.0.0` — stable public release
|
|
45
|
+
|
|
46
|
+
## CLI MVP (`commit-wise`)
|
|
47
|
+
|
|
48
|
+
This repository now includes a minimal local CLI for staged-change review.
|
|
49
|
+
|
|
50
|
+
### Commands
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
commit-wise init
|
|
54
|
+
commit-wise review
|
|
55
|
+
commit-wise explain
|
|
56
|
+
commit-wise commit
|
|
57
|
+
commit-wise hooks install
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The old `gai` alias is still available:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
gai init
|
|
64
|
+
gai review
|
|
65
|
+
gai explain
|
|
66
|
+
gai commit
|
|
67
|
+
gai hooks install
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### What `commit-wise review` does
|
|
71
|
+
|
|
72
|
+
- Reads staged files from `git diff --cached --name-only`
|
|
73
|
+
- Reads staged diff from `git diff --cached`
|
|
74
|
+
- Runs local analyzers when installed (`ruff`, `mypy`, `pytest`, `bandit`)
|
|
75
|
+
- Prints actionable review suggestions and score in terminal
|
|
76
|
+
|
|
77
|
+
### Security
|
|
78
|
+
|
|
79
|
+
`gai init` stores provider tokens in the system keyring (`keyring` package), not in plain-text config.
|
|
@@ -1,90 +1,91 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: commitwise-review
|
|
3
|
-
Version: 0.1.
|
|
4
|
-
Summary: Git staged-change AI review helper
|
|
5
|
-
Author: Gokulakrishnan
|
|
6
|
-
Requires-Python: >=3.11
|
|
7
|
-
Description-Content-Type: text/markdown
|
|
8
|
-
License-File: LICENSE
|
|
9
|
-
Requires-Dist: keyring
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
- `0.
|
|
54
|
-
- `0.2.
|
|
55
|
-
- `
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
commit-wise
|
|
66
|
-
commit-wise
|
|
67
|
-
commit-wise
|
|
68
|
-
commit-wise
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
gai
|
|
76
|
-
gai
|
|
77
|
-
gai
|
|
78
|
-
gai
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
- Reads staged
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: commitwise-review
|
|
3
|
+
Version: 0.1.3
|
|
4
|
+
Summary: Git staged-change AI review helper
|
|
5
|
+
Author: Gokulakrishnan
|
|
6
|
+
Requires-Python: >=3.11
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Requires-Dist: keyring
|
|
10
|
+
Requires-Dist: azure-ai-inference
|
|
11
|
+
Dynamic: license-file
|
|
12
|
+
|
|
13
|
+
# Commit-wise
|
|
14
|
+
|
|
15
|
+
Open Source Commit and PR reviewer.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
Install the library from PyPI:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install commitwise-review
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Install directly from the source repository:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pip install .
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Install from GitHub:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install git+https://github.com/gokul-1998/Commit-wise.git
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
To force reinstall:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pip install --force-reinstall --no-cache-dir git+https://github.com/gokul-1998/Commit-wise.git
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Versioning
|
|
44
|
+
|
|
45
|
+
This project uses Semantic Versioning:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
MAJOR.MINOR.PATCH
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Example release plan:
|
|
52
|
+
|
|
53
|
+
- `0.1.0` — initial release
|
|
54
|
+
- `0.2.0` — new features
|
|
55
|
+
- `0.2.1` — bug fixes and prompt improvements
|
|
56
|
+
- `1.0.0` — stable public release
|
|
57
|
+
|
|
58
|
+
## CLI MVP (`commit-wise`)
|
|
59
|
+
|
|
60
|
+
This repository now includes a minimal local CLI for staged-change review.
|
|
61
|
+
|
|
62
|
+
### Commands
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
commit-wise init
|
|
66
|
+
commit-wise review
|
|
67
|
+
commit-wise explain
|
|
68
|
+
commit-wise commit
|
|
69
|
+
commit-wise hooks install
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The old `gai` alias is still available:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
gai init
|
|
76
|
+
gai review
|
|
77
|
+
gai explain
|
|
78
|
+
gai commit
|
|
79
|
+
gai hooks install
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### What `commit-wise review` does
|
|
83
|
+
|
|
84
|
+
- Reads staged files from `git diff --cached --name-only`
|
|
85
|
+
- Reads staged diff from `git diff --cached`
|
|
86
|
+
- Runs local analyzers when installed (`ruff`, `mypy`, `pytest`, `bandit`)
|
|
87
|
+
- Prints actionable review suggestions and score in terminal
|
|
88
|
+
|
|
89
|
+
### Security
|
|
90
|
+
|
|
91
|
+
`gai init` stores provider tokens in the system keyring (`keyring` package), not in plain-text config.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"""gai package."""
|
|
1
|
+
"""gai package."""
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from gai.cli.main import main
|
|
2
|
-
|
|
3
|
-
if __name__ == "__main__":
|
|
4
|
-
raise SystemExit(main())
|
|
1
|
+
from gai.cli.main import main
|
|
2
|
+
|
|
3
|
+
if __name__ == "__main__":
|
|
4
|
+
raise SystemExit(main())
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import shutil
|
|
4
|
-
import subprocess
|
|
5
|
-
from pathlib import Path
|
|
6
|
-
|
|
7
|
-
TOOLS = [
|
|
8
|
-
("Ruff", ["ruff", "check", "."]),
|
|
9
|
-
("MyPy", ["mypy", "."]),
|
|
10
|
-
("Pytest", ["pytest", "tests/"]),
|
|
11
|
-
("Bandit", ["bandit", "-r", "."]),
|
|
12
|
-
]
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
def run_local_analyzers(cwd: Path) -> list[tuple[str, str]]:
|
|
16
|
-
reports: list[tuple[str, str]] = []
|
|
17
|
-
for name, cmd in TOOLS:
|
|
18
|
-
if shutil.which(cmd[0]) is None:
|
|
19
|
-
reports.append((name, "not installed (skipped)"))
|
|
20
|
-
continue
|
|
21
|
-
|
|
22
|
-
proc = subprocess.run(cmd, cwd=str(cwd), check=False, capture_output=True, text=True)
|
|
23
|
-
status = "passed" if proc.returncode == 0 else "issues found"
|
|
24
|
-
output = (proc.stdout + "\n" + proc.stderr).strip()
|
|
25
|
-
if output:
|
|
26
|
-
output = output[:1500]
|
|
27
|
-
reports.append((name, f"{status}: {output}"))
|
|
28
|
-
else:
|
|
29
|
-
reports.append((name, status))
|
|
30
|
-
return reports
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import shutil
|
|
4
|
+
import subprocess
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
TOOLS = [
|
|
8
|
+
("Ruff", ["ruff", "check", "."]),
|
|
9
|
+
("MyPy", ["mypy", "."]),
|
|
10
|
+
("Pytest", ["pytest", "tests/"]),
|
|
11
|
+
("Bandit", ["bandit", "-r", "."]),
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def run_local_analyzers(cwd: Path) -> list[tuple[str, str]]:
|
|
16
|
+
reports: list[tuple[str, str]] = []
|
|
17
|
+
for name, cmd in TOOLS:
|
|
18
|
+
if shutil.which(cmd[0]) is None:
|
|
19
|
+
reports.append((name, "not installed (skipped)"))
|
|
20
|
+
continue
|
|
21
|
+
|
|
22
|
+
proc = subprocess.run(cmd, cwd=str(cwd), check=False, capture_output=True, text=True)
|
|
23
|
+
status = "passed" if proc.returncode == 0 else "issues found"
|
|
24
|
+
output = (proc.stdout + "\n" + proc.stderr).strip()
|
|
25
|
+
if output:
|
|
26
|
+
output = output[:1500]
|
|
27
|
+
reports.append((name, f"{status}: {output}"))
|
|
28
|
+
else:
|
|
29
|
+
reports.append((name, status))
|
|
30
|
+
return reports
|