From 23af9ef44816b8a693652dd9d47d99b31c5ae789 Mon Sep 17 00:00:00 2001 From: def Date: Sun, 12 Jun 2022 12:34:20 +0200 Subject: [PATCH] Tell what has to be changed in check_header_guards.py Example: Wrong header guard in src/game/bezier.h, is: #ifndef GAAME_BEZIER_H, should be: #ifndef GAME_BEZIER_H --- scripts/check_header_guards.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/check_header_guards.py b/scripts/check_header_guards.py index 5d3c74a6c..97b75a7bd 100755 --- a/scripts/check_header_guards.py +++ b/scripts/check_header_guards.py @@ -23,14 +23,14 @@ def check_file(filename): break if line[0] == "/" or line[0] == "*" or line[0] == "\r" or line[0] == "\n" or line[0] == "\t": continue + header_guard = "#ifndef " + ("_".join(filename.split(PATH)[1].split("/"))[:-2]).upper() + "_H" if line.startswith("#ifndef"): - header_guard = "#ifndef " + ("_".join(filename.split(PATH)[1].split("/"))[:-2]).upper() + "_H" if line[:-1] != header_guard: error = True - print("Wrong header guard in {}".format(filename)) + print("Wrong header guard in {}, is: {}, should be: {}".format(filename, line[:-1], header_guard)) else: error = True - print("Missing header guard in {}".format(filename)) + print("Missing header guard in {}, should be: {}".format(filename, header_guard)) break return error