Updated the copyright headers and clang-format scripts.

This commit is contained in:
Relintai 2023-12-17 22:14:52 +01:00
parent ab55049582
commit 9eb2fb05e4
2 changed files with 17 additions and 7 deletions

View File

@ -34,7 +34,7 @@ while IFS= read -rd '' f; do
elif [[ "$f" == "platform/android/java/lib/src/org/pandemoniumengine/pandemonium/utils/ProcessPhoenix"* ]]; then elif [[ "$f" == "platform/android/java/lib/src/org/pandemoniumengine/pandemonium/utils/ProcessPhoenix"* ]]; then
continue 2 continue 2
fi fi
#python misc/scripts/copyright_headers.py "$f" python misc/scripts/copyright_headers.py "$f"
continue 2 continue 2
fi fi
done done

View File

@ -7,12 +7,13 @@ header = """\
/*************************************************************************/ /*************************************************************************/
/* $filename */ /* $filename */
/*************************************************************************/ /*************************************************************************/
/* This file is part of: */ /* This file is part of: */
/* GODOT ENGINE */ /* PANDEMONIUM ENGINE */
/* https://godotengine.org */ /* https://github.com/Relintai/pandemonium_engine */
/*************************************************************************/ /*************************************************************************/
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2022-present Péter Magyar. */
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */ /* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
/* */ /* */
/* Permission is hereby granted, free of charge, to any person obtaining */ /* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */ /* a copy of this software and associated documentation files (the */
@ -66,11 +67,20 @@ text += "\n"
# then we can append the rest (step 2). # then we can append the rest (step 2).
fileread = open(fname.strip(), "r") fileread = open(fname.strip(), "r")
line = fileread.readline() line = fileread.readline().strip()
header_done = False header_done = False
while line.strip() == "": # Skip empty lines at the top orig_lines = ""
while line == "" or line.startswith("#ifndef") or line.startswith("#define"): # Skip empty lines at the top, and include guards
if line != "":
orig_lines += line + "\n"
line = fileread.readline() line = fileread.readline()
line = line.strip()
if orig_lines != "":
text = orig_lines + "\n" + text
if line.find("/**********") == -1: # Pandemonium header starts this way if line.find("/**********") == -1: # Pandemonium header starts this way
# Maybe starting with a non-Pandemonium comment, abort header magic # Maybe starting with a non-Pandemonium comment, abort header magic