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

Function _strip_strings_and_comments

ci/lint_cpp/bare_using_checker.py:74–82  ·  view source on GitHub ↗

Remove string literals and single-line comments from a line for analysis.

(line: str)

Source from the content-addressed store, hash-verified

72
73
74def _strip_strings_and_comments(line: str) -> str:
75 """Remove string literals and single-line comments from a line for analysis."""
76 # Remove string literals (simple approach)
77 result = re.sub(r'"[^"\\]*(?:\\.[^"\\]*)*"', '""', line)
78 # Remove single-line comments but preserve suppression check on original
79 comment_match = _RE_LINE_COMMENT.search(result)
80 if comment_match:
81 result = result[: comment_match.start()]
82 return result
83
84
85class BareUsingChecker(FileContentChecker):

Callers 1

check_file_contentMethod · 0.85

Calls 1

startMethod · 0.45

Tested by

no test coverage detected