MCPcopy Create free account
hub / github.com/FastLED/FastLED / run_cpp_lint

Function run_cpp_lint

ci/debug_attached.py:110–164  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

108
109
110def 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
167def run_compile(

Callers 3

_run_native_autoresearchFunction · 0.90
_run_build_deployFunction · 0.90
mainFunction · 0.70

Calls 4

get_utf8_envFunction · 0.90
printFunction · 0.50
runMethod · 0.45

Tested by

no test coverage detected