MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / _strip_line_comments

Function _strip_line_comments

scripts/code_verify_rules.py:2664–2670  ·  view source on GitHub ↗

Replace only `//` line comments with spaces -- string literals remain visible. Used when the rule cares about the contents of strings.

(line: str)

Source from the content-addressed store, hash-verified

2662
2663
2664def _strip_line_comments(line: str) -> str:
2665 """Replace only `//` line comments with spaces -- string literals remain
2666 visible. Used when the rule cares about the contents of strings."""
2667 idx = line.find("//")
2668 if idx >= 0:
2669 return line[:idx] + " " * (len(line) - idx)
2670 return line
2671
2672
2673# Tooling pragmas a compiler or another linter reads. Deleting one changes

Callers 2

_cpp_rulesFunction · 0.85
_qml_rulesFunction · 0.85

Calls 1

findMethod · 0.80

Tested by

no test coverage detected