Run C++ linting using unified runner (matches 'bash lint' behavior). This function mirrors the C++ linting approach from the 'lint' script to ensure consistent behavior between 'bash autoresearch' and 'bash lint'. Returns: True if linting succeeded, False otherwise
()
| 108 | |
| 109 | |
| 110 | def run_cpp_lint() -> bool: |
| 111 | """Run C++ linting using unified runner (matches 'bash lint' behavior). |
| 112 | |
| 113 | This function mirrors the C++ linting approach from the 'lint' script to ensure |
| 114 | consistent behavior between 'bash autoresearch' and 'bash lint'. |
| 115 | |
| 116 | Returns: |
| 117 | True if linting succeeded, False otherwise |
| 118 | """ |
| 119 | print("=" * 60) |
| 120 | print("LINTING C++ CODE") |
| 121 | print("=" * 60) |
| 122 | print("Running C++ linters (unified runner - matches 'bash lint')") |
| 123 | print() |
| 124 | |
| 125 | project_root = Path(__file__).parent.parent |
| 126 | |
| 127 | try: |
| 128 | # Phase 1: Run unified C++ checker (all content-based linters in one pass) |
| 129 | # This is the same as 'bash lint' line 200 |
| 130 | print("🔍 Running unified C++ checker (all content-based linters in one pass)") |
| 131 | result = subprocess.run( |
| 132 | ["uv", "run", "python", "ci/lint_cpp/run_all_checkers.py"], |
| 133 | cwd=project_root, |
| 134 | env=get_utf8_env(), |
| 135 | ) |
| 136 | if result.returncode != 0: |
| 137 | print("❌ Unified C++ linter failed") |
| 138 | return False |
| 139 | |
| 140 | print() |
| 141 | |
| 142 | # Phase 3: Run relative includes check for src/ only |
| 143 | # This is the same as 'bash lint' line 219 |
| 144 | print("🔗 Running relative includes check (cpp_lint.py for src/ only)") |
| 145 | result = subprocess.run( |
| 146 | ["uv", "run", "python", "cpp_lint.py", "src/"], |
| 147 | cwd=project_root, |
| 148 | env=get_utf8_env(), |
| 149 | ) |
| 150 | if result.returncode != 0: |
| 151 | print("❌ cpp_lint.py failed: Found relative includes in src/") |
| 152 | return False |
| 153 | |
| 154 | print() |
| 155 | print("✅ All C++ lint checks passed\n") |
| 156 | return True |
| 157 | |
| 158 | except KeyboardInterrupt as ki: |
| 159 | print("\nKeyboardInterrupt: Stopping linting") |
| 160 | handle_keyboard_interrupt(ki) |
| 161 | raise |
| 162 | except Exception as e: |
| 163 | print(f"❌ Error running C++ linting: {e}") |
| 164 | return False |
| 165 | |
| 166 | |
| 167 | def run_compile( |
no test coverage detected