We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 22188ed commit 38cb014Copy full SHA for 38cb014
hcl2/rule_transformer/rules/whitespace.py
@@ -22,16 +22,19 @@ def to_list(
22
if comment == "\n":
23
return None
24
25
- comment = comment.strip()
26
comments = comment.split("\n")
27
28
result = []
29
for comment in comments:
30
- if comment.startswith("//"):
31
- comment = comment[2:]
+ comment = comment.strip()
32
33
- elif comment.startswith("#"):
34
- comment = comment[1:]
+ for delimiter in ("//", "/*", "#"):
+
+ if comment.startswith(delimiter):
+ comment = comment[len(delimiter) :]
35
36
+ if comment.endswith("*/"):
37
+ comment = comment[:-2]
38
39
if comment != "":
40
result.append(comment.strip())
0 commit comments