Skip to content
Snippets Groups Projects
Commit e14e5b13 authored by Sebastian Eibl's avatar Sebastian Eibl
Browse files

very basic script to find missing include guards

searches for #pragma once in every .h file
parent 945d0a73
No related merge requests found
#!/usr/bin/env python3
import os
error = False
for root, dirnames, filenames in os.walk(".."):
for filename in filenames:
if filename.endswith((".h")) and not filename.endswith((".impl.h")):
if not "extern" in root:
file = os.path.join(root, filename)
if not "#pragma once" in open(file).read():
print(file)
error = True
if error:
exit(-1)
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