Replace only `//` line comments with spaces -- string literals remain visible. Used when the rule cares about the contents of strings.
(line: str)
| 2662 | |
| 2663 | |
| 2664 | def _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 |
no test coverage detected