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

Function _run_clang_query

ci/tools/check_noexcept.py:246–289  ·  view source on GitHub ↗

Run clang-query and return filtered missing-FL_NOEXCEPT hits.

(
    clang_query: list[str], tu: str, file_regex: str
)

Source from the content-addressed store, hash-verified

244
245
246def _run_clang_query(
247 clang_query: list[str], tu: str, file_regex: str
248) -> list[NoexceptHit]:
249 """Run clang-query and return filtered missing-FL_NOEXCEPT hits."""
250 result = subprocess.run(
251 [*clang_query, tu, "--", *_COMPILER_ARGS],
252 input=build_query(file_regex),
253 capture_output=True,
254 text=True,
255 cwd=str(PROJECT_ROOT),
256 timeout=300,
257 )
258 output = result.stdout + result.stderr
259 if result.returncode != 0:
260 raise NoexceptCheckError(output.strip() or "clang-query failed")
261 if (
262 "Error parsing argument" in output
263 or "Error parsing matcher" in output
264 or "Matcher not found" in output
265 ):
266 raise NoexceptCheckError(output.strip())
267
268 hits: list[NoexceptHit] = []
269 seen: set[tuple[str, int]] = set()
270 for match in _MATCH_OUTPUT_RE.finditer(output):
271 filepath = match.group(1).replace("\\", "/")
272 line_num = int(match.group(2))
273 key = (filepath, line_num)
274 if key in seen:
275 continue
276 seen.add(key)
277
278 line_text, signature = _read_source_signature(filepath, line_num)
279 if _signature_is_exempt(signature):
280 continue
281 hits.append(
282 NoexceptHit(
283 path=filepath,
284 line=line_num,
285 line_text=line_text,
286 signature=signature,
287 )
288 )
289 return hits
290
291
292def find_missing_noexcept(scope: str = "all") -> list[NoexceptHit]:

Callers 1

find_missing_noexceptFunction · 0.70

Calls 9

build_queryFunction · 0.85
NoexceptCheckErrorClass · 0.85
_read_source_signatureFunction · 0.85
_signature_is_exemptFunction · 0.85
NoexceptHitClass · 0.85
setClass · 0.50
runMethod · 0.45
addMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected