From 400be4a532086b48a0529f3bdb972879c332a60f Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 5 Nov 2025 03:29:18 +0000 Subject: [PATCH] fix: Resolve codebase quality issues - Update version from 1.1.0 to 1.4.0 in pyproject.toml to match codebase - Remove duplicate astunparse dependency from requirements.txt - Add Black as optional dependency in pyproject.toml for refactoring feature - Move disharmonious_class_method.py from harmonizer/ to examples/ - Fix CI workflow to reference harmonizer/ instead of outdated src/ directory - Update CONTRIBUTING.md to use correct harmonizer/ paths for linting/formatting - Document GeopoliticalAnalyzer as experimental/unused code in divine_invitation_engine_V2.py All tests passing (24/24) --- .github/workflows/harmony-check.yml | 6 +++--- CONTRIBUTING.md | 4 ++-- {harmonizer => examples}/disharmonious_class_method.py | 0 harmonizer/divine_invitation_engine_V2.py | 9 ++++++++- pyproject.toml | 5 ++++- requirements.txt | 1 - 6 files changed, 17 insertions(+), 8 deletions(-) rename {harmonizer => examples}/disharmonious_class_method.py (100%) diff --git a/.github/workflows/harmony-check.yml b/.github/workflows/harmony-check.yml index a9e02a5..5997155 100644 --- a/.github/workflows/harmony-check.yml +++ b/.github/workflows/harmony-check.yml @@ -34,7 +34,7 @@ jobs: # Exit codes: 0=harmonious, 1=medium, 2=high, 3=critical # Note: Currently informational as source code itself has some disharmony # (main.py functions do more than their names suggest - great meta example!) - find src -name "*.py" -type f | xargs harmonizer || { + find harmonizer -name "*.py" -type f | xargs harmonizer || { echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "⚠️ Source code has disharmony (demonstrates tool working!)" echo " This is a great example of semantic issues the tool catches." @@ -76,7 +76,7 @@ jobs: echo "📋 Generating detailed JSON harmony report..." # Generate JSON report for all Python files - find src examples tests -name "*.py" -type f | xargs harmonizer --format json > harmony-report.json 2>/dev/null || true + find harmonizer examples tests -name "*.py" -type f | xargs harmonizer --format json > harmony-report.json 2>/dev/null || true # Display summary if report was generated if [ -f harmony-report.json ] && [ -s harmony-report.json ]; then @@ -170,7 +170,7 @@ jobs: # Use stricter threshold (0.3 instead of default 0.5) # This catches even minor semantic drift - if find src -name "*.py" -type f | xargs harmonizer --threshold 0.3; then + if find harmonizer -name "*.py" -type f | xargs harmonizer --threshold 0.3; then echo "✅ Code meets excellent harmony standards!" else echo "" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7b61673..d4401d9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -55,7 +55,7 @@ We use `black` for code formatting and `flake8` for linting to ensure a consiste Before you commit your changes, please run `black` to automatically format your code: ```sh -black src/ tests/ +black harmonizer/ tests/ ``` ### Linting @@ -63,7 +63,7 @@ black src/ tests/ You can check for any style issues or potential errors with `flake8`: ```sh -flake8 src/ tests/ +flake8 harmonizer/ tests/ ``` Our Continuous Integration (CI) pipeline will automatically check for formatting and linting issues, so it's a good idea to run these tools locally before pushing your changes. diff --git a/harmonizer/disharmonious_class_method.py b/examples/disharmonious_class_method.py similarity index 100% rename from harmonizer/disharmonious_class_method.py rename to examples/disharmonious_class_method.py diff --git a/harmonizer/divine_invitation_engine_V2.py b/harmonizer/divine_invitation_engine_V2.py index 831b605..9f616f3 100644 --- a/harmonizer/divine_invitation_engine_V2.py +++ b/harmonizer/divine_invitation_engine_V2.py @@ -451,7 +451,14 @@ def infer_unknown_meaning( class GeopoliticalAnalyzer: - """Optimized geopolitical analysis""" + """ + Optimized geopolitical analysis + + NOTE: This class is currently not integrated into the main analysis pipeline. + It provides experimental capabilities for analyzing entity postures and relationships + in a geopolitical context using the 4D semantic framework. Available for future + extensions or custom use cases. + """ def __init__(self, vocab_manager: VocabularyManager, analyzer: SemanticAnalyzer): self.vocab = vocab_manager diff --git a/pyproject.toml b/pyproject.toml index 77f6d9e..4d8cd69 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "PythonCodeHarmonizer" -version = "1.1.0" +version = "1.4.0" description = "A semantic code debugger." readme = "README.md" license = { file="LICENSE" } @@ -16,6 +16,9 @@ classifiers = [ [project.scripts] harmonizer = "harmonizer.main:run_cli" +[project.optional-dependencies] +refactor = ["black>=24.4.2"] + [tool.setuptools.packages.find] where = ["."] include = ["harmonizer"] diff --git a/requirements.txt b/requirements.txt index 09187b0..3bb496d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,6 @@ pytest black==24.4.2 astunparse==1.6.3 -astunparse==1.6.3 flake8 isort pre-commit