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

Function looks_like_fastled_code

ci/lint_cpp/include_paths_checker.py:167–198  ·  view source on GitHub ↗

Check if the include path looks like FastLED code (not SDK code). FastLED code characteristics: - Uses .hpp extension (SDK headers almost never use this) - Uses .cpp extension (should never be included) - Has FastLED-specific naming patterns

(include_path: str)

Source from the content-addressed store, hash-verified

165
166
167def looks_like_fastled_code(include_path: str) -> bool:
168 """Check if the include path looks like FastLED code (not SDK code).
169
170 FastLED code characteristics:
171 - Uses .hpp extension (SDK headers almost never use this)
172 - Uses .cpp extension (should never be included)
173 - Has FastLED-specific naming patterns
174 """
175 # .hpp is almost exclusively used by FastLED, not SDK headers
176 if include_path.endswith(".hpp"):
177 return True
178
179 # .cpp files should never be included as headers
180 if include_path.endswith(".cpp"):
181 return True
182
183 # Common FastLED naming patterns
184 fastled_patterns = (
185 "clockless",
186 "fastpin",
187 "fastspi",
188 "led_sysdefs",
189 "compile_test",
190 "spi_output",
191 "is_", # Platform detection headers like is_avr.h, is_arm.h
192 )
193 filename = include_path.split("/")[-1]
194 for pattern in fastled_patterns:
195 if pattern in filename.lower():
196 return True
197
198 return False
199
200
201def is_external_sdk_header(include_path: str) -> bool:

Callers 2

is_external_sdk_headerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected