You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Define dummy arguments, local variables, and procedure declarations on separate lines."""
19
20
20
21
flines= []
21
22
withopen(path, "r") asf:
@@ -63,7 +64,7 @@ def separate_lines(path):
63
64
64
65
@staticmethod
65
66
deftrailing_returns(path):
66
-
"""Remove return statements at the end of routines"""
67
+
"""Remove return statements (and corresponding comments) at the end of routines."""
67
68
68
69
flines= []
69
70
withopen(path, "r") asf:
@@ -96,9 +97,10 @@ def trailing_returns(path):
96
97
@staticmethod
97
98
defcleanup_comments(path):
98
99
"""
99
-
Remove comments on lines with only whitespace, remove '--' from the beginnings
100
-
of comments, make sure comment spacing is consistent (one space after '!'),
101
-
remove horizontal dividers consisting of '-' or '*', remove 'SPECIFICATION'
100
+
Remove empty comments (containing only '!', or '!' followed by some number of '-' or '='),
101
+
remove double dashes from beginnings of comments (e.g., '! -- comment' becomes '! comment'),
102
+
remove 'SPECIFICATION' comment lines, and make internal comment spacing consistent (one space
103
+
after '!' before text begins).
102
104
"""
103
105
104
106
flines= []
@@ -170,26 +172,42 @@ def reformat(
170
172
action="store_true",
171
173
default=True,
172
174
required=False,
173
-
help="Define dummy arguments and local variables on separate lines.",
175
+
help="Define dummy arguments, local variables, and procedure declarations on separate lines.",
174
176
)
175
177
parser.add_argument(
176
178
"--trailing-returns",
177
179
action="store_true",
178
180
default=True,
179
181
required=False,
180
-
help="Remove return statements at the end of routines.",
182
+
help="Remove return statements (and corresponding comments) at the end of routines.",
181
183
)
182
184
parser.add_argument(
183
185
"--cleanup-comments",
184
186
action="store_true",
185
187
default=True,
186
188
required=False,
187
-
help="Remove empty comments (containing only '!', or '!' followed by some number of '-' or '='), remove double dashes from beginnings of comments (e.g., '! -- comment' becomes '! comment'), and make internal comment spacing consistent (one space after '!' before text begins).",
189
+
help="Remove empty comments (containing only '!', or '!' followed by some number of '-' or '='), remove double dashes from beginnings of comments (e.g., '! -- comment' becomes '! comment'), remove 'SPECIFICATION' comment lines, and make internal comment spacing consistent (one space after '!' before text begins).",
0 commit comments