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

Function is_fastled_platform_relative

ci/lint_cpp/include_paths_checker.py:224–245  ·  view source on GitHub ↗

Check if the include path looks like a relative include to FastLED platform code. These are paths that should use "platforms/" prefix but don't. For example: "esp/foo.h" should be "platforms/esp/foo.h" For ambiguous prefixes like avr/ and arm/, we only flag them as FastLED platform

(include_path: str)

Source from the content-addressed store, hash-verified

222
223
224def is_fastled_platform_relative(include_path: str) -> bool:
225 """Check if the include path looks like a relative include to FastLED platform code.
226
227 These are paths that should use "platforms/" prefix but don't.
228 For example: "esp/foo.h" should be "platforms/esp/foo.h"
229
230 For ambiguous prefixes like avr/ and arm/, we only flag them as FastLED
231 platform code if they look like FastLED code (e.g., .hpp files, specific
232 FastLED naming patterns).
233 """
234 # Check unambiguous FastLED platform subdirs
235 for subdir in FASTLED_PLATFORM_SUBDIRS:
236 if include_path.startswith(subdir):
237 return True
238
239 # For ambiguous prefixes, check if it looks like FastLED code
240 for prefix in AMBIGUOUS_PREFIXES:
241 if include_path.startswith(prefix):
242 if looks_like_fastled_code(include_path):
243 return True
244
245 return False
246
247
248def get_banned_subpath_replacement(include_path: str) -> str | None:

Callers 2

check_file_contentMethod · 0.70
apply_fixesFunction · 0.70

Calls 1

looks_like_fastled_codeFunction · 0.85

Tested by

no test coverage detected