Skip to content

Commit f2e309d

Browse files
authored
Merge pull request #13 from BruinGrowly/claude/fix-black-formatting-011CUf7NJcXsSSKr1fXAedS5
feat: Add v1.2 features - Exit codes, JSON output, and enhanced badges
2 parents 0eecf2c + 5da8232 commit f2e309d

File tree

4 files changed

+328
-30
lines changed

4 files changed

+328
-30
lines changed

CHANGELOG.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,74 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
## [Unreleased]
1111

12+
---
13+
14+
## [1.2.0] - 2025-11-01
15+
16+
### Added
17+
- **Exit codes for CI/CD integration** 🚀
18+
- `0` = All harmonious (excellent or low severity)
19+
- `1` = Medium severity found (0.5-0.8)
20+
- `2` = High severity found (0.8-1.2)
21+
- `3` = Critical severity found (≥ 1.2)
22+
- Enables automated quality gates in pipelines
23+
- Build fails automatically on high/critical disharmony
24+
25+
- **JSON output format** 📊
26+
- `--format json` option for machine-readable output
27+
- Structured data for tool integration
28+
- Includes severity levels, scores, and summary statistics
29+
- Perfect for IDEs, dashboards, and analytics
30+
31+
- **Enhanced command-line interface**
32+
- Argument parsing with argparse
33+
- `--version` flag
34+
- `--threshold` option for custom thresholds
35+
- Comprehensive `--help` with examples
36+
- Multiple file support improved
37+
38+
- **Enhanced README badges**
39+
- CI status badge
40+
- Version badge
41+
- Test pass rate badge
42+
- Harmony score badge (meta!)
43+
- All clickable with relevant links
44+
45+
### Changed
46+
- Version bumped to 1.2
47+
- Improved CLI usability with better help text
48+
- Quiet mode when using JSON output
49+
50+
### Documentation
51+
- Quick Reference guide updated with v1.2 features
52+
- Exit code examples for CI/CD
53+
- JSON output format examples
54+
- Advanced usage patterns
55+
56+
---
57+
58+
## [1.1.0] - 2025-10-31
59+
1260
### Added
1361
- Comprehensive documentation suite
1462
- Integration templates (GitHub Actions, pre-commit, VS Code)
1563
- Quick reference guide
1664
- Tool comparison guide
1765
- Troubleshooting guide
1866
- Real-world example files
67+
- Complete refactoring journey examples
68+
- Severity level demonstrations
69+
70+
### Documentation
71+
- USER_GUIDE.md (~14K words)
72+
- TUTORIAL.md (~19K words)
73+
- FAQ.md (~19K words)
74+
- PHILOSOPHY.md (~22K words)
75+
- ARCHITECTURE.md (~23K words)
76+
- API.md (~21K words)
77+
- COMPARISON.md (~11K words)
78+
- QUICK_REFERENCE.md (~5K words)
79+
- TROUBLESHOOTING.md (~11K words)
1980

2081
---
2182

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# Python Code Harmonizer
22

3-
[![MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
4-
[![Python Versions](https://img.shields.io/badge/python-3.8+-blue.svg)]()
3+
[![CI Status](https://github.com/BruinGrowly/Python-Code-Harmonizer/workflows/Python%20Code%20Harmonizer%20CI/badge.svg)](https://github.com/BruinGrowly/Python-Code-Harmonizer/actions)
4+
[![Version](https://img.shields.io/badge/version-1.2-blue.svg)](CHANGELOG.md)
5+
[![Python Versions](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/)
6+
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
57
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
8+
[![Tests](https://img.shields.io/badge/tests-20%20passed-brightgreen.svg)](tests/)
9+
[![Harmony Score](https://img.shields.io/badge/harmony-0.15-brightgreen.svg)](examples/test_code.py)
610

711
**The world's first semantic code debugger.**
812

docs/QUICK_REFERENCE.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,63 @@ find src/ -name "*.py" -exec harmonizer {} \;
3333

3434
---
3535

36+
## Advanced Options (v1.2+)
37+
38+
```bash
39+
# JSON output format (for tools/CI/CD)
40+
harmonizer --format json myfile.py
41+
42+
# Custom threshold
43+
harmonizer --threshold 0.7 myfile.py
44+
45+
# Check version
46+
harmonizer --version
47+
48+
# Get help
49+
harmonizer --help
50+
```
51+
52+
### Exit Codes for CI/CD
53+
54+
Harmonizer returns meaningful exit codes:
55+
56+
| Exit Code | Severity | Score Range |
57+
|-----------|----------|-------------|
58+
| `0` | Excellent/Low | < 0.5 |
59+
| `1` | Medium | 0.5 - 0.8 |
60+
| `2` | High | 0.8 - 1.2 |
61+
| `3` | Critical | ≥ 1.2 |
62+
63+
**Use in CI/CD:**
64+
```yaml
65+
- name: Check Code Harmony
66+
run: harmonizer src/**/*.py # Will fail build if critical
67+
```
68+
69+
### JSON Output Example
70+
71+
```json
72+
{
73+
"version": "1.2",
74+
"threshold": 0.5,
75+
"files": [{
76+
"file": "myfile.py",
77+
"functions": [{
78+
"name": "get_user",
79+
"score": 0.95,
80+
"severity": "high",
81+
"disharmonious": true
82+
}]
83+
}],
84+
"summary": {
85+
"total_functions": 10,
86+
"severity_counts": { "critical": 1, "high": 2 }
87+
}
88+
}
89+
```
90+
91+
---
92+
3693
## Score Interpretation
3794

3895
| Score | Status | Meaning | Action |

0 commit comments

Comments
 (0)