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

Function _clean_flags

ci/check_backend_flag_drift.py:253–274  ·  view source on GitHub ↗

Drop build-noise flags AND the operand that follows standalone path flags. Without consuming the operand, tokens like ``header.h`` (after ``-include``) or ``foo.o`` (after ``-o``) survive normalization and masquerade as drift signal. This loop is the single normalization site that b

(flags: list[str])

Source from the content-addressed store, hash-verified

251
252
253def _clean_flags(flags: list[str]) -> set[str]:
254 """Drop build-noise flags AND the operand that follows standalone path flags.
255
256 Without consuming the operand, tokens like ``header.h`` (after
257 ``-include``) or ``foo.o`` (after ``-o``) survive normalization and
258 masquerade as drift signal. This loop is the single normalization site
259 that both ``cc_flags`` and ``cxx_flags`` flow through.
260 """
261 cleaned: set[str] = set()
262 skip_next = False
263 for flag in flags:
264 if skip_next:
265 skip_next = False
266 continue
267 if flag in _STANDALONE_PATH_FLAGS or flag in _FLAGS_WITH_VALUE:
268 # The argv token after one of these is a path operand. Drop it.
269 skip_next = True
270 continue
271 if _should_ignore_flag(flag):
272 continue
273 cleaned.add(_normalize_flag(flag))
274 return cleaned
275
276
277def normalize_build_info(raw: dict, board: str, backend: str) -> NormalizedFlags:

Callers 1

normalize_build_infoFunction · 0.85

Calls 4

_should_ignore_flagFunction · 0.85
_normalize_flagFunction · 0.85
setClass · 0.50
addMethod · 0.45

Tested by

no test coverage detected