vibescore 0.1.0__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.
- vibescore-0.1.0/.github/workflows/ci.yml +21 -0
- vibescore-0.1.0/.gitignore +16 -0
- vibescore-0.1.0/CHANGELOG.md +15 -0
- vibescore-0.1.0/LICENSE +21 -0
- vibescore-0.1.0/PKG-INFO +205 -0
- vibescore-0.1.0/README.md +168 -0
- vibescore-0.1.0/pyproject.toml +75 -0
- vibescore-0.1.0/src/vibescore/__init__.py +18 -0
- vibescore-0.1.0/src/vibescore/_types.py +42 -0
- vibescore-0.1.0/src/vibescore/cli.py +62 -0
- vibescore-0.1.0/src/vibescore/deps.py +172 -0
- vibescore-0.1.0/src/vibescore/discovery.py +102 -0
- vibescore-0.1.0/src/vibescore/py.typed +0 -0
- vibescore-0.1.0/src/vibescore/quality.py +192 -0
- vibescore-0.1.0/src/vibescore/report.py +156 -0
- vibescore-0.1.0/src/vibescore/scanner.py +49 -0
- vibescore-0.1.0/src/vibescore/scoring.py +71 -0
- vibescore-0.1.0/src/vibescore/security.py +128 -0
- vibescore-0.1.0/src/vibescore/testing.py +164 -0
- vibescore-0.1.0/tests/test_cli.py +104 -0
- vibescore-0.1.0/tests/test_deps.py +122 -0
- vibescore-0.1.0/tests/test_discovery.py +131 -0
- vibescore-0.1.0/tests/test_quality.py +234 -0
- vibescore-0.1.0/tests/test_report.py +103 -0
- vibescore-0.1.0/tests/test_scanner.py +75 -0
- vibescore-0.1.0/tests/test_scoring.py +120 -0
- vibescore-0.1.0/tests/test_security.py +212 -0
- vibescore-0.1.0/tests/test_testing_module.py +150 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
- uses: actions/setup-python@v5
|
|
18
|
+
with:
|
|
19
|
+
python-version: ${{ matrix.python-version }}
|
|
20
|
+
- run: pip install -e ".[all]" pytest
|
|
21
|
+
- run: python -m pytest tests/ -v --tb=short
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.1.0] - 2025-04-10
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- Initial release
|
|
7
|
+
- Code quality analysis (VC201–VC209): function length, complexity, parameters, type annotations, nesting, star imports, docstrings, mutable defaults
|
|
8
|
+
- Security analysis (VC301–VC309): hardcoded secrets, AWS keys, SQL injection, shell injection, unsafe deserialization, eval/exec, debug mode, private keys
|
|
9
|
+
- Dependency analysis (VC401–VC405): version pinning, lock files, deprecated setup.py
|
|
10
|
+
- Testing analysis (VC501–VC506): test presence, count, CI, conftest, test ratio
|
|
11
|
+
- ASCII terminal report with letter grades (A+ through F)
|
|
12
|
+
- JSON output format for CI pipelines
|
|
13
|
+
- `--min-score` flag for threshold-based CI gating
|
|
14
|
+
- Python library API: `from vibe_check import scan`
|
|
15
|
+
- Zero external dependencies
|
vibescore-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
(full text at http://www.apache.org/licenses/LICENSE-2.0)
|
|
8
|
+
|
|
9
|
+
Copyright 2025 Zacharie B
|
|
10
|
+
|
|
11
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
you may not use this file except in compliance with the License.
|
|
13
|
+
You may obtain a copy of the License at
|
|
14
|
+
|
|
15
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
|
|
17
|
+
Unless required by applicable law or agreed to in writing, software
|
|
18
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
+
See the License for the specific language governing permissions and
|
|
21
|
+
limitations under the License.
|
vibescore-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vibescore
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Grade your vibe-coded project. One command, instant letter grade across security, quality, dependencies, and testing.
|
|
5
|
+
Project-URL: Homepage, https://github.com/stef41/vibe-check
|
|
6
|
+
Project-URL: Repository, https://github.com/stef41/vibe-check
|
|
7
|
+
Project-URL: Issues, https://github.com/stef41/vibe-check/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/stef41/vibe-check/blob/main/CHANGELOG.md
|
|
9
|
+
Author: Zacharie B
|
|
10
|
+
License: Apache-2.0
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: ai-generated-code,code-analysis,code-grade,code-quality,code-review,developer-tools,linter,security,static-analysis,vibe-coding
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: Security
|
|
24
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
25
|
+
Classifier: Topic :: Software Development :: Testing
|
|
26
|
+
Classifier: Typing :: Typed
|
|
27
|
+
Requires-Python: >=3.9
|
|
28
|
+
Provides-Extra: all
|
|
29
|
+
Requires-Dist: click>=8.0; extra == 'all'
|
|
30
|
+
Requires-Dist: rich>=13.0; extra == 'all'
|
|
31
|
+
Provides-Extra: cli
|
|
32
|
+
Requires-Dist: click>=8.0; extra == 'cli'
|
|
33
|
+
Requires-Dist: rich>=13.0; extra == 'cli'
|
|
34
|
+
Provides-Extra: rich
|
|
35
|
+
Requires-Dist: rich>=13.0; extra == 'rich'
|
|
36
|
+
Description-Content-Type: text/markdown
|
|
37
|
+
|
|
38
|
+
# 🎵 vibe-check
|
|
39
|
+
|
|
40
|
+
**Grade your vibe-coded project. One command. Instant letter grade.**
|
|
41
|
+
|
|
42
|
+
[](https://pypi.org/project/vibe-check/)
|
|
43
|
+
[](LICENSE)
|
|
44
|
+
[](https://pypi.org/project/vibe-check/)
|
|
45
|
+
[]()
|
|
46
|
+
|
|
47
|
+
> "Vibe coding" is the new reality — you prompt, AI writes, you ship.
|
|
48
|
+
> But **is your vibe-coded project actually good?**
|
|
49
|
+
> Find out in 10 seconds.
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
$ vibescore .
|
|
53
|
+
|
|
54
|
+
🎵 Vibe Check v0.1.0
|
|
55
|
+
══════════════════════════════════════════════
|
|
56
|
+
|
|
57
|
+
Project: tokonomics
|
|
58
|
+
Files: 40 (32 Python, 8 other)
|
|
59
|
+
Lines: 4,658
|
|
60
|
+
Scanned in 0.12s
|
|
61
|
+
|
|
62
|
+
┌──────────────────┬────────┬───────┐
|
|
63
|
+
│ Category │ Score │ Grade │
|
|
64
|
+
├──────────────────┼────────┼───────┤
|
|
65
|
+
│ Code Quality │ 52.0 │ F │
|
|
66
|
+
│ Security │ 100.0 │ A+ │
|
|
67
|
+
│ Dependencies │ 98.0 │ A+ │
|
|
68
|
+
│ Testing │ 100.0 │ A+ │
|
|
69
|
+
├──────────────────┼────────┼───────┤
|
|
70
|
+
│ Overall │ 87.6 │ B+ │
|
|
71
|
+
└──────────────────┴────────┴───────┘
|
|
72
|
+
|
|
73
|
+
🟡 Warnings (11)
|
|
74
|
+
VC201 Function 'export_svg_chart' too long (102 lines)
|
|
75
|
+
VC202 Function '_build_cli' high complexity (30)
|
|
76
|
+
VC203 Function 'export_svg_chart' has 6 parameters (>5)
|
|
77
|
+
...
|
|
78
|
+
|
|
79
|
+
💡 Tips
|
|
80
|
+
• Reduce function complexity and add type annotations
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Install
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
pip install vibescore
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
That's it. Zero dependencies. Works with Python 3.9+.
|
|
90
|
+
|
|
91
|
+
## Usage
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# Grade the current directory
|
|
95
|
+
vibescore .
|
|
96
|
+
|
|
97
|
+
# Grade a specific project
|
|
98
|
+
vibescore /path/to/project
|
|
99
|
+
|
|
100
|
+
# JSON output (for CI pipelines)
|
|
101
|
+
vibescore . --format json
|
|
102
|
+
|
|
103
|
+
# Fail CI if score is below threshold
|
|
104
|
+
vibescore . --min-score 70
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### As a Python library
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
from vibescore import scan
|
|
111
|
+
|
|
112
|
+
report = scan(".")
|
|
113
|
+
print(f"Grade: {report.overall_grade} ({report.overall_score:.0f}/100)")
|
|
114
|
+
|
|
115
|
+
for category in report.categories:
|
|
116
|
+
print(f" {category.name}: {category.grade}")
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## What It Checks
|
|
120
|
+
|
|
121
|
+
| Category | Checks | Codes |
|
|
122
|
+
|----------|--------|-------|
|
|
123
|
+
| **Code Quality** | Function length, cyclomatic complexity, parameter count, type annotations, nesting depth, star imports, docstrings, mutable defaults | VC201–VC209 |
|
|
124
|
+
| **Security** | Hardcoded secrets, AWS keys, SQL injection, shell injection, unsafe deserialization, eval/exec, debug mode, private keys | VC301–VC309 |
|
|
125
|
+
| **Dependencies** | Version pinning, lock files, deprecated setup.py, wildcard pins | VC401–VC405 |
|
|
126
|
+
| **Testing** | Test file presence, test count, CI configuration, conftest.py, test-to-code ratio | VC501–VC506 |
|
|
127
|
+
|
|
128
|
+
## Grading Scale
|
|
129
|
+
|
|
130
|
+
| Grade | Score | Grade | Score |
|
|
131
|
+
|-------|-------|-------|-------|
|
|
132
|
+
| A+ | 97–100 | C+ | 77–79 |
|
|
133
|
+
| A | 93–96 | C | 73–76 |
|
|
134
|
+
| A- | 90–92 | C- | 70–72 |
|
|
135
|
+
| B+ | 87–89 | D+ | 67–69 |
|
|
136
|
+
| B | 83–86 | D | 63–66 |
|
|
137
|
+
| B- | 80–82 | D- | 60–62 |
|
|
138
|
+
| | | F | 0–59 |
|
|
139
|
+
|
|
140
|
+
## CI Integration
|
|
141
|
+
|
|
142
|
+
### GitHub Actions
|
|
143
|
+
|
|
144
|
+
```yaml
|
|
145
|
+
- name: Vibe Check
|
|
146
|
+
run: |
|
|
147
|
+
pip install vibescore
|
|
148
|
+
vibescore . --min-score 70
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Pre-commit (manual)
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
# In your Makefile or CI script
|
|
155
|
+
vibescore . --min-score 70 --format json > vibe-report.json
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## How Scoring Works
|
|
159
|
+
|
|
160
|
+
Each category is scored 0–100 independently. The overall score is a weighted average:
|
|
161
|
+
|
|
162
|
+
| Category | Weight |
|
|
163
|
+
|----------|--------|
|
|
164
|
+
| Security | 30% |
|
|
165
|
+
| Code Quality | 25% |
|
|
166
|
+
| Testing | 25% |
|
|
167
|
+
| Dependencies | 20% |
|
|
168
|
+
|
|
169
|
+
Security is weighted highest because a security bug in vibe-coded projects can be catastrophic.
|
|
170
|
+
|
|
171
|
+
## Why vibe-check?
|
|
172
|
+
|
|
173
|
+
Vibe coding means AI writes most of your code. That's fast, but it introduces risks:
|
|
174
|
+
|
|
175
|
+
- **AI hallucinates long functions** that are hard to debug
|
|
176
|
+
- **AI skips security basics** like input validation and secret management
|
|
177
|
+
- **AI often omits tests** or writes superficial ones
|
|
178
|
+
- **AI uses loose dependency pins** that break on updates
|
|
179
|
+
|
|
180
|
+
`vibescore` catches these patterns in seconds, so you can ship fast *and* ship safe.
|
|
181
|
+
|
|
182
|
+
## FAQ
|
|
183
|
+
|
|
184
|
+
**Q: Does this only work with Python?**
|
|
185
|
+
A: Currently Python-focused for code quality and testing analysis. Security and dependency checks work with any project type. More languages coming soon.
|
|
186
|
+
|
|
187
|
+
**Q: Does it phone home or require an API key?**
|
|
188
|
+
A: No. Zero network requests. Zero dependencies. Runs entirely offline.
|
|
189
|
+
|
|
190
|
+
**Q: How is this different from pylint/ruff/flake8?**
|
|
191
|
+
A: Those are line-level linters. `vibescore` gives you a project-level grade across security, quality, testing, and dependencies — a holistic view of your vibe-coded project's health. Use both.
|
|
192
|
+
|
|
193
|
+
## See Also
|
|
194
|
+
|
|
195
|
+
Tools in the same ecosystem:
|
|
196
|
+
|
|
197
|
+
- [tokonomics](https://github.com/stef41/tokonomics) — LLM token cost management
|
|
198
|
+
- [injectionguard](https://github.com/stef41/injectionguard) — Prompt injection detection
|
|
199
|
+
- [vibesafe](https://github.com/stef41/vibesafe) — AI code safety scanner
|
|
200
|
+
- [castwright](https://github.com/stef41/castwright) — Synthetic training data generator
|
|
201
|
+
- [infermark](https://github.com/stef41/infermark) — LLM inference benchmarking
|
|
202
|
+
|
|
203
|
+
## License
|
|
204
|
+
|
|
205
|
+
Apache-2.0
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# 🎵 vibe-check
|
|
2
|
+
|
|
3
|
+
**Grade your vibe-coded project. One command. Instant letter grade.**
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/vibe-check/)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://pypi.org/project/vibe-check/)
|
|
8
|
+
[]()
|
|
9
|
+
|
|
10
|
+
> "Vibe coding" is the new reality — you prompt, AI writes, you ship.
|
|
11
|
+
> But **is your vibe-coded project actually good?**
|
|
12
|
+
> Find out in 10 seconds.
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
$ vibescore .
|
|
16
|
+
|
|
17
|
+
🎵 Vibe Check v0.1.0
|
|
18
|
+
══════════════════════════════════════════════
|
|
19
|
+
|
|
20
|
+
Project: tokonomics
|
|
21
|
+
Files: 40 (32 Python, 8 other)
|
|
22
|
+
Lines: 4,658
|
|
23
|
+
Scanned in 0.12s
|
|
24
|
+
|
|
25
|
+
┌──────────────────┬────────┬───────┐
|
|
26
|
+
│ Category │ Score │ Grade │
|
|
27
|
+
├──────────────────┼────────┼───────┤
|
|
28
|
+
│ Code Quality │ 52.0 │ F │
|
|
29
|
+
│ Security │ 100.0 │ A+ │
|
|
30
|
+
│ Dependencies │ 98.0 │ A+ │
|
|
31
|
+
│ Testing │ 100.0 │ A+ │
|
|
32
|
+
├──────────────────┼────────┼───────┤
|
|
33
|
+
│ Overall │ 87.6 │ B+ │
|
|
34
|
+
└──────────────────┴────────┴───────┘
|
|
35
|
+
|
|
36
|
+
🟡 Warnings (11)
|
|
37
|
+
VC201 Function 'export_svg_chart' too long (102 lines)
|
|
38
|
+
VC202 Function '_build_cli' high complexity (30)
|
|
39
|
+
VC203 Function 'export_svg_chart' has 6 parameters (>5)
|
|
40
|
+
...
|
|
41
|
+
|
|
42
|
+
💡 Tips
|
|
43
|
+
• Reduce function complexity and add type annotations
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Install
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pip install vibescore
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
That's it. Zero dependencies. Works with Python 3.9+.
|
|
53
|
+
|
|
54
|
+
## Usage
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Grade the current directory
|
|
58
|
+
vibescore .
|
|
59
|
+
|
|
60
|
+
# Grade a specific project
|
|
61
|
+
vibescore /path/to/project
|
|
62
|
+
|
|
63
|
+
# JSON output (for CI pipelines)
|
|
64
|
+
vibescore . --format json
|
|
65
|
+
|
|
66
|
+
# Fail CI if score is below threshold
|
|
67
|
+
vibescore . --min-score 70
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### As a Python library
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
from vibescore import scan
|
|
74
|
+
|
|
75
|
+
report = scan(".")
|
|
76
|
+
print(f"Grade: {report.overall_grade} ({report.overall_score:.0f}/100)")
|
|
77
|
+
|
|
78
|
+
for category in report.categories:
|
|
79
|
+
print(f" {category.name}: {category.grade}")
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## What It Checks
|
|
83
|
+
|
|
84
|
+
| Category | Checks | Codes |
|
|
85
|
+
|----------|--------|-------|
|
|
86
|
+
| **Code Quality** | Function length, cyclomatic complexity, parameter count, type annotations, nesting depth, star imports, docstrings, mutable defaults | VC201–VC209 |
|
|
87
|
+
| **Security** | Hardcoded secrets, AWS keys, SQL injection, shell injection, unsafe deserialization, eval/exec, debug mode, private keys | VC301–VC309 |
|
|
88
|
+
| **Dependencies** | Version pinning, lock files, deprecated setup.py, wildcard pins | VC401–VC405 |
|
|
89
|
+
| **Testing** | Test file presence, test count, CI configuration, conftest.py, test-to-code ratio | VC501–VC506 |
|
|
90
|
+
|
|
91
|
+
## Grading Scale
|
|
92
|
+
|
|
93
|
+
| Grade | Score | Grade | Score |
|
|
94
|
+
|-------|-------|-------|-------|
|
|
95
|
+
| A+ | 97–100 | C+ | 77–79 |
|
|
96
|
+
| A | 93–96 | C | 73–76 |
|
|
97
|
+
| A- | 90–92 | C- | 70–72 |
|
|
98
|
+
| B+ | 87–89 | D+ | 67–69 |
|
|
99
|
+
| B | 83–86 | D | 63–66 |
|
|
100
|
+
| B- | 80–82 | D- | 60–62 |
|
|
101
|
+
| | | F | 0–59 |
|
|
102
|
+
|
|
103
|
+
## CI Integration
|
|
104
|
+
|
|
105
|
+
### GitHub Actions
|
|
106
|
+
|
|
107
|
+
```yaml
|
|
108
|
+
- name: Vibe Check
|
|
109
|
+
run: |
|
|
110
|
+
pip install vibescore
|
|
111
|
+
vibescore . --min-score 70
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Pre-commit (manual)
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# In your Makefile or CI script
|
|
118
|
+
vibescore . --min-score 70 --format json > vibe-report.json
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## How Scoring Works
|
|
122
|
+
|
|
123
|
+
Each category is scored 0–100 independently. The overall score is a weighted average:
|
|
124
|
+
|
|
125
|
+
| Category | Weight |
|
|
126
|
+
|----------|--------|
|
|
127
|
+
| Security | 30% |
|
|
128
|
+
| Code Quality | 25% |
|
|
129
|
+
| Testing | 25% |
|
|
130
|
+
| Dependencies | 20% |
|
|
131
|
+
|
|
132
|
+
Security is weighted highest because a security bug in vibe-coded projects can be catastrophic.
|
|
133
|
+
|
|
134
|
+
## Why vibe-check?
|
|
135
|
+
|
|
136
|
+
Vibe coding means AI writes most of your code. That's fast, but it introduces risks:
|
|
137
|
+
|
|
138
|
+
- **AI hallucinates long functions** that are hard to debug
|
|
139
|
+
- **AI skips security basics** like input validation and secret management
|
|
140
|
+
- **AI often omits tests** or writes superficial ones
|
|
141
|
+
- **AI uses loose dependency pins** that break on updates
|
|
142
|
+
|
|
143
|
+
`vibescore` catches these patterns in seconds, so you can ship fast *and* ship safe.
|
|
144
|
+
|
|
145
|
+
## FAQ
|
|
146
|
+
|
|
147
|
+
**Q: Does this only work with Python?**
|
|
148
|
+
A: Currently Python-focused for code quality and testing analysis. Security and dependency checks work with any project type. More languages coming soon.
|
|
149
|
+
|
|
150
|
+
**Q: Does it phone home or require an API key?**
|
|
151
|
+
A: No. Zero network requests. Zero dependencies. Runs entirely offline.
|
|
152
|
+
|
|
153
|
+
**Q: How is this different from pylint/ruff/flake8?**
|
|
154
|
+
A: Those are line-level linters. `vibescore` gives you a project-level grade across security, quality, testing, and dependencies — a holistic view of your vibe-coded project's health. Use both.
|
|
155
|
+
|
|
156
|
+
## See Also
|
|
157
|
+
|
|
158
|
+
Tools in the same ecosystem:
|
|
159
|
+
|
|
160
|
+
- [tokonomics](https://github.com/stef41/tokonomics) — LLM token cost management
|
|
161
|
+
- [injectionguard](https://github.com/stef41/injectionguard) — Prompt injection detection
|
|
162
|
+
- [vibesafe](https://github.com/stef41/vibesafe) — AI code safety scanner
|
|
163
|
+
- [castwright](https://github.com/stef41/castwright) — Synthetic training data generator
|
|
164
|
+
- [infermark](https://github.com/stef41/infermark) — LLM inference benchmarking
|
|
165
|
+
|
|
166
|
+
## License
|
|
167
|
+
|
|
168
|
+
Apache-2.0
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "vibescore"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Grade your vibe-coded project. One command, instant letter grade across security, quality, dependencies, and testing."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = {text = "Apache-2.0"}
|
|
11
|
+
requires-python = ">=3.9"
|
|
12
|
+
authors = [{ name = "Zacharie B" }]
|
|
13
|
+
keywords = [
|
|
14
|
+
"vibe-coding",
|
|
15
|
+
"code-quality",
|
|
16
|
+
"security",
|
|
17
|
+
"linter",
|
|
18
|
+
"code-analysis",
|
|
19
|
+
"ai-generated-code",
|
|
20
|
+
"static-analysis",
|
|
21
|
+
"code-review",
|
|
22
|
+
"code-grade",
|
|
23
|
+
"developer-tools",
|
|
24
|
+
]
|
|
25
|
+
classifiers = [
|
|
26
|
+
"Development Status :: 4 - Beta",
|
|
27
|
+
"Environment :: Console",
|
|
28
|
+
"Intended Audience :: Developers",
|
|
29
|
+
"License :: OSI Approved :: Apache Software License",
|
|
30
|
+
"Programming Language :: Python :: 3",
|
|
31
|
+
"Programming Language :: Python :: 3.9",
|
|
32
|
+
"Programming Language :: Python :: 3.10",
|
|
33
|
+
"Programming Language :: Python :: 3.11",
|
|
34
|
+
"Programming Language :: Python :: 3.12",
|
|
35
|
+
"Programming Language :: Python :: 3.13",
|
|
36
|
+
"Topic :: Software Development :: Quality Assurance",
|
|
37
|
+
"Topic :: Software Development :: Testing",
|
|
38
|
+
"Topic :: Security",
|
|
39
|
+
"Typing :: Typed",
|
|
40
|
+
]
|
|
41
|
+
dependencies = []
|
|
42
|
+
|
|
43
|
+
[project.optional-dependencies]
|
|
44
|
+
rich = ["rich>=13.0"]
|
|
45
|
+
cli = ["click>=8.0", "rich>=13.0"]
|
|
46
|
+
all = ["vibescore[cli]"]
|
|
47
|
+
|
|
48
|
+
[project.scripts]
|
|
49
|
+
vibe-check = "vibe_check.cli:_entry"
|
|
50
|
+
|
|
51
|
+
[project.urls]
|
|
52
|
+
Homepage = "https://github.com/stef41/vibe-check"
|
|
53
|
+
Repository = "https://github.com/stef41/vibe-check"
|
|
54
|
+
Issues = "https://github.com/stef41/vibe-check/issues"
|
|
55
|
+
Changelog = "https://github.com/stef41/vibe-check/blob/main/CHANGELOG.md"
|
|
56
|
+
|
|
57
|
+
[tool.hatch.build.targets.wheel]
|
|
58
|
+
packages = ["src/vibescore"]
|
|
59
|
+
|
|
60
|
+
[tool.pytest.ini_options]
|
|
61
|
+
testpaths = ["tests"]
|
|
62
|
+
addopts = "-v --tb=short"
|
|
63
|
+
|
|
64
|
+
[tool.ruff]
|
|
65
|
+
target-version = "py39"
|
|
66
|
+
line-length = 99
|
|
67
|
+
|
|
68
|
+
[tool.ruff.lint]
|
|
69
|
+
select = ["E", "F", "W", "I", "N", "UP", "B", "SIM", "TCH"]
|
|
70
|
+
|
|
71
|
+
[tool.mypy]
|
|
72
|
+
python_version = "3.9"
|
|
73
|
+
strict = true
|
|
74
|
+
warn_return_any = true
|
|
75
|
+
warn_unused_configs = true
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
__version__ = "0.1.0"
|
|
4
|
+
|
|
5
|
+
from .scanner import scan
|
|
6
|
+
from ._types import VibeReport, CategoryScore, Issue, FileInfo
|
|
7
|
+
from .scoring import score_to_grade, compute_overall
|
|
8
|
+
|
|
9
|
+
__all__ = [
|
|
10
|
+
"scan",
|
|
11
|
+
"VibeReport",
|
|
12
|
+
"CategoryScore",
|
|
13
|
+
"Issue",
|
|
14
|
+
"FileInfo",
|
|
15
|
+
"score_to_grade",
|
|
16
|
+
"compute_overall",
|
|
17
|
+
"__version__",
|
|
18
|
+
]
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass, field
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@dataclass
|
|
7
|
+
class FileInfo:
|
|
8
|
+
path: str
|
|
9
|
+
language: str # "python", "javascript", "typescript", "unknown"
|
|
10
|
+
lines: int
|
|
11
|
+
size_bytes: int
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@dataclass
|
|
15
|
+
class Issue:
|
|
16
|
+
code: str # e.g. "VC101"
|
|
17
|
+
severity: str # "critical", "warning", "info"
|
|
18
|
+
message: str
|
|
19
|
+
file: str | None = None
|
|
20
|
+
line: int | None = None
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@dataclass
|
|
24
|
+
class CategoryScore:
|
|
25
|
+
name: str
|
|
26
|
+
score: float # 0-100
|
|
27
|
+
grade: str # A+ through F
|
|
28
|
+
issues: list[Issue] = field(default_factory=list)
|
|
29
|
+
details: dict = field(default_factory=dict)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@dataclass
|
|
33
|
+
class VibeReport:
|
|
34
|
+
project_path: str
|
|
35
|
+
project_name: str
|
|
36
|
+
total_files: int
|
|
37
|
+
total_lines: int
|
|
38
|
+
languages: dict[str, int] # language -> file count
|
|
39
|
+
categories: list[CategoryScore] = field(default_factory=list)
|
|
40
|
+
overall_score: float = 0.0
|
|
41
|
+
overall_grade: str = "?"
|
|
42
|
+
scan_time_s: float = 0.0
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
import os
|
|
5
|
+
import sys
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def main(argv: list[str] | None = None) -> int:
|
|
9
|
+
from . import __version__
|
|
10
|
+
|
|
11
|
+
parser = argparse.ArgumentParser(
|
|
12
|
+
prog="vibe-check",
|
|
13
|
+
description="\U0001f3b5 Grade your vibe-coded project",
|
|
14
|
+
)
|
|
15
|
+
parser.add_argument(
|
|
16
|
+
"path", nargs="?", default=".", help="Project directory to scan (default: .)"
|
|
17
|
+
)
|
|
18
|
+
parser.add_argument(
|
|
19
|
+
"--format",
|
|
20
|
+
choices=["text", "json"],
|
|
21
|
+
default="text",
|
|
22
|
+
help="Output format",
|
|
23
|
+
)
|
|
24
|
+
parser.add_argument(
|
|
25
|
+
"--min-score",
|
|
26
|
+
type=float,
|
|
27
|
+
default=0,
|
|
28
|
+
help="Exit with code 1 if overall score is below this threshold",
|
|
29
|
+
)
|
|
30
|
+
parser.add_argument(
|
|
31
|
+
"--version", action="version", version=f"%(prog)s {__version__}"
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
args = parser.parse_args(argv)
|
|
35
|
+
|
|
36
|
+
path = args.path
|
|
37
|
+
if not os.path.isdir(path):
|
|
38
|
+
print(f"Error: '{path}' is not a directory", file=sys.stderr)
|
|
39
|
+
return 1
|
|
40
|
+
|
|
41
|
+
from .scanner import scan
|
|
42
|
+
from .report import format_report, format_json
|
|
43
|
+
|
|
44
|
+
report = scan(path)
|
|
45
|
+
|
|
46
|
+
if args.format == "json":
|
|
47
|
+
print(format_json(report))
|
|
48
|
+
else:
|
|
49
|
+
print(format_report(report))
|
|
50
|
+
|
|
51
|
+
if report.overall_score < args.min_score:
|
|
52
|
+
return 1
|
|
53
|
+
return 0
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _entry() -> None:
|
|
57
|
+
"""Wrapper for console_scripts entry-point."""
|
|
58
|
+
sys.exit(main())
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
if __name__ == "__main__":
|
|
62
|
+
sys.exit(main())
|