Skip to content
Snippets Groups Projects
Commit 8817da8a authored by Maciej Domanski's avatar Maciej Domanski
Browse files

Removed a modified file from pr

parent 1149b131
Branches
Tags
No related merge requests found
...@@ -58,16 +58,16 @@ def custom_format(filename): ...@@ -58,16 +58,16 @@ def custom_format(filename):
in_define = True in_define = True
if ( if (
"/*" in line "/*" in line
and not line.strip().startswith("/*") and not line.strip().startswith("/*")
and line.endswith("*/") and line.endswith("*/")
and len(line) < (COLUMN_LIMIT - 2) and len(line) < (COLUMN_LIMIT - 2)
): ):
cmt_start = line.rfind("/*") cmt_start = line.rfind("/*")
line = ( line = (
line[:cmt_start] line[:cmt_start]
+ " " * (COLUMN_LIMIT - 2 - len(line)) + " " * (COLUMN_LIMIT - 2 - len(line))
+ line[cmt_start:] + line[cmt_start:]
) )
define_padding = 0 define_padding = 0
...@@ -76,21 +76,21 @@ def custom_format(filename): ...@@ -76,21 +76,21 @@ def custom_format(filename):
define_padding = max(0, len(last_line[last_line.rfind("\n") + 1 :])) define_padding = max(0, len(last_line[last_line.rfind("\n") + 1 :]))
if ( if (
last_line is not None last_line is not None
and last_line.strip().endswith("{") and last_line.strip().endswith("{")
and line.strip() != "" and line.strip() != ""
): ):
line = (" " * define_padding + "\\" if in_define else "") + "\n" + line line = (" " * define_padding + "\\" if in_define else "") + "\n" + line
elif ( elif (
last_line is not None last_line is not None
and last_line.strip().startswith("}") and last_line.strip().startswith("}")
and line.strip() != "" and line.strip() != ""
): ):
line = (" " * define_padding + "\\" if in_define else "") + "\n" + line line = (" " * define_padding + "\\" if in_define else "") + "\n" + line
elif ( elif (
line.strip().startswith("}") line.strip().startswith("}")
and last_line is not None and last_line is not None
and last_line.strip() != "" and last_line.strip() != ""
): ):
line = (" " * define_padding + "\\" if in_define else "") + "\n" + line line = (" " * define_padding + "\\" if in_define else "") + "\n" + line
...@@ -123,4 +123,4 @@ for filename in args: ...@@ -123,4 +123,4 @@ for filename in args:
with open(filename, "w") as f: with open(filename, "w") as f:
f.write(code) f.write(code)
else: else:
print(code) print(code)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment