Commit 7f5c1cd0 authored by Yue Wang's avatar Yue Wang Committed by Timo Koch
Browse files

[cleanup] script to remove clutter after header guards

parent c34ecfaf
#!/usr/bin/python3
import os
# replace everything after last #endif with new line
def clearAfterLastEndIf(filename):
with open(filename, 'r') as header:
split = header.read().split("#endif")
split[-1] = '\n'
with open(filename, 'w') as header:
header.write("#endif".join(split))
for root, _, files in os.walk(os.getcwd()):
for file in files:
if file.endswith(".hh"):
clearAfterLastEndIf(os.path.join(root, file))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment