[Fix] Remove all emoji violations from code files
- Replaced emojis with ASCII text markers ([OK], [ERROR], [WARNING], etc.) - Fixed 38+ violations across 20 files (7 Python, 6 shell scripts, 6 hooks, 1 API) - All modified files pass syntax verification - Conforms to CODING_GUIDELINES.md NO EMOJIS rule Details: - Python test files: check_record_counts.py, test_*.py (31 fixes) - API utils: context_compression.py regex pattern updated - Shell scripts: setup/test/install/upgrade scripts (64+ fixes) - Hook scripts: task-complete, user-prompt-submit, sync-contexts (10 fixes) Verification: All files pass syntax checks (python -m py_compile, bash -n) Report: FIXES_APPLIED.md contains complete change log Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,7 @@ def test_model_import():
|
||||
"""Test importing all models from api.models."""
|
||||
try:
|
||||
import api.models
|
||||
print("✅ Import successful")
|
||||
print("[SUCCESS] Import successful")
|
||||
|
||||
# Get all model classes (exclude private attributes and modules)
|
||||
all_classes = [attr for attr in dir(api.models) if not attr.startswith('_') and attr[0].isupper()]
|
||||
@@ -30,7 +30,7 @@ def test_model_import():
|
||||
|
||||
return models
|
||||
except Exception as e:
|
||||
print(f"❌ Import failed: {e}")
|
||||
print(f"[ERROR] Import failed: {e}")
|
||||
traceback.print_exc()
|
||||
return []
|
||||
|
||||
@@ -43,11 +43,11 @@ def test_model_structure(model_name):
|
||||
|
||||
# Check if it's actually a class
|
||||
if not isinstance(model_cls, type):
|
||||
return f"❌ FAIL: {model_name} - Not a class"
|
||||
return f"[FAIL] {model_name} - Not a class"
|
||||
|
||||
# Check for __tablename__
|
||||
if not hasattr(model_cls, '__tablename__'):
|
||||
return f"❌ FAIL: {model_name} - Missing __tablename__"
|
||||
return f"[FAIL] {model_name} - Missing __tablename__"
|
||||
|
||||
# Check for __table_args__ (optional but should exist if defined)
|
||||
has_table_args = hasattr(model_cls, '__table_args__')
|
||||
@@ -70,10 +70,10 @@ def test_model_structure(model_name):
|
||||
else:
|
||||
details.append(f"not_instantiable({inst_msg[:50]})")
|
||||
|
||||
return f"✅ PASS: {model_name} - {', '.join(details)}"
|
||||
return f"[PASS] {model_name} - {', '.join(details)}"
|
||||
|
||||
except Exception as e:
|
||||
return f"❌ FAIL: {model_name} - {str(e)}"
|
||||
return f"[FAIL] {model_name} - {str(e)}"
|
||||
|
||||
def main():
|
||||
print("=" * 70)
|
||||
@@ -85,7 +85,7 @@ def main():
|
||||
models = test_model_import()
|
||||
|
||||
if not models:
|
||||
print("\n❌ CRITICAL: Failed to import models module")
|
||||
print("\n[CRITICAL] Failed to import models module")
|
||||
sys.exit(1)
|
||||
|
||||
# Test 2: Validate each model structure
|
||||
@@ -100,7 +100,7 @@ def main():
|
||||
result = test_model_structure(model_name)
|
||||
results.append(result)
|
||||
|
||||
if result.startswith("✅"):
|
||||
if result.startswith("[PASS]"):
|
||||
passed += 1
|
||||
else:
|
||||
failed += 1
|
||||
@@ -113,14 +113,14 @@ def main():
|
||||
print("-" * 70)
|
||||
print(f"\n[SUMMARY]")
|
||||
print(f"Total models: {len(models)}")
|
||||
print(f"✅ Passed: {passed}")
|
||||
print(f"❌ Failed: {failed}")
|
||||
print(f"[PASS] Passed: {passed}")
|
||||
print(f"[FAIL] Failed: {failed}")
|
||||
|
||||
if failed == 0:
|
||||
print(f"\n🎉 All {passed} models validated successfully!")
|
||||
print(f"\n[SUCCESS] All {passed} models validated successfully!")
|
||||
sys.exit(0)
|
||||
else:
|
||||
print(f"\n⚠️ {failed} model(s) need attention")
|
||||
print(f"\n[WARNING] {failed} model(s) need attention")
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user