From e14e5b13e63cab7d115b8bb496902149c78aff6d Mon Sep 17 00:00:00 2001
From: Sebastian Eibl <sebastian.eibl@fau.de>
Date: Thu, 16 Nov 2017 14:09:39 +0100
Subject: [PATCH] very basic script to find missing include guards

searches for #pragma once in every .h file
---
 utilities/findMissingIncludeGuards.py | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100755 utilities/findMissingIncludeGuards.py

diff --git a/utilities/findMissingIncludeGuards.py b/utilities/findMissingIncludeGuards.py
new file mode 100755
index 000000000..f2c4561ad
--- /dev/null
+++ b/utilities/findMissingIncludeGuards.py
@@ -0,0 +1,16 @@
+#!/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)
-- 
GitLab