Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 42 additions & 42 deletions .github/workflows/harmony-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,23 +82,23 @@ jobs:
if [ -f harmony-report.json ] && [ -s harmony-report.json ]; then
echo ""
echo "📊 Harmony Summary:"
python3 << 'PYTHON_SCRIPT'
import json
try:
with open('harmony-report.json') as f:
data = json.load(f)
summary = data.get('summary', {})
print(f" Total files: {summary.get('total_files', 0)}")
print(f" Total functions: {summary.get('total_functions', 0)}")
print(" Severity breakdown:")
for sev, count in summary.get('severity_counts', {}).items():
if count > 0:
emoji = {'critical': '🔴', 'high': '🟠', 'medium': '🟡', 'low': '🔵', 'excellent': '🟢'}.get(sev, '⚪')
print(f" {emoji} {sev.capitalize()}: {count}")
print(f" Highest severity: {summary.get('highest_severity', 'unknown')}")
except Exception as e:
print(f"Error parsing report: {e}")
PYTHON_SCRIPT
python3 <<'PYTHON_SCRIPT'
import json
try:
with open('harmony-report.json') as f:
data = json.load(f)
summary = data.get('summary', {})
print(f" Total files: {summary.get('total_files', 0)}")
print(f" Total functions: {summary.get('total_functions', 0)}")
print(" Severity breakdown:")
for sev, count in summary.get('severity_counts', {}).items():
if count > 0:
emoji = {'critical': '🔴', 'high': '🟠', 'medium': '🟡', 'low': '🔵', 'excellent': '🟢'}.get(sev, '⚪')
print(f" {emoji} {sev.capitalize()}: {count}")
print(f" Highest severity: {summary.get('highest_severity', 'unknown')}")
except Exception as e:
print(f"Error parsing report: {e}")
PYTHON_SCRIPT
else
echo "⚠️ No harmony report generated"
fi
Expand All @@ -116,31 +116,31 @@ PYTHON_SCRIPT
if [ -f harmony-report.json ] && [ -s harmony-report.json ]; then
echo ""
echo "🎯 Top 5 Functions to Refactor:"
python3 << 'PYTHON_SCRIPT'
import json
try:
with open('harmony-report.json') as f:
data = json.load(f)
funcs = []
for file_data in data.get('files', []):
for func in file_data.get('functions', []):
if func.get('disharmonious'):
funcs.append((
func.get('score', 0),
func.get('name', 'unknown'),
file_data.get('file', 'unknown'),
func.get('severity', 'unknown')
))
funcs.sort(reverse=True)
if funcs:
for i, (score, name, filepath, sev) in enumerate(funcs[:5], 1):
emoji = {'critical': '🔴', 'high': '🟠', 'medium': '🟡'}.get(sev, '⚪')
print(f" {i}. {emoji} {name} ({score:.2f}) in {filepath}")
else:
print(' 🎉 No disharmonious functions found!')
except Exception as e:
print(f"Error parsing report: {e}")
PYTHON_SCRIPT
python3 <<'PYTHON_SCRIPT'
import json
try:
with open('harmony-report.json') as f:
data = json.load(f)
funcs = []
for file_data in data.get('files', []):
for func in file_data.get('functions', []):
if func.get('disharmonious'):
funcs.append((
func.get('score', 0),
func.get('name', 'unknown'),
file_data.get('file', 'unknown'),
func.get('severity', 'unknown')
))
funcs.sort(reverse=True)
if funcs:
for i, (score, name, filepath, sev) in enumerate(funcs[:5], 1):
emoji = {'critical': '🔴', 'high': '🟠', 'medium': '🟡'}.get(sev, '⚪')
print(f" {i}. {emoji} {name} ({score:.2f}) in {filepath}")
else:
print(' 🎉 No disharmonious functions found!')
except Exception as e:
print(f"Error parsing report: {e}")
PYTHON_SCRIPT
fi
if: success() || failure()

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
__pycache__/
*.egg-info/
harmony-report.json
Loading