From 3661303dbf2f00e4622d97790bed7f47dcc735b7 Mon Sep 17 00:00:00 2001 From: "Stephen G. Tuggy" Date: Sun, 12 Jan 2025 15:29:12 -0800 Subject: [PATCH] More on add_gpl_license.py --- script/add_gpl_license.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/script/add_gpl_license.py b/script/add_gpl_license.py index a52232e9b6..fa91cd6e59 100644 --- a/script/add_gpl_license.py +++ b/script/add_gpl_license.py @@ -142,6 +142,11 @@ def remove_license_header(filepath: Path) -> None: if first_line.startswith('#!'): output_file.write(first_line) + # Handle the line that a few of our C++ source files have at or near the top that looks like this: + # // -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- + elif first_line.startswith('// -*- '): + output_file.write(first_line) + # If first line isn't a comment, then short-circuit this whole process. There is no comment block to delete elif not is_a_comment(first_line, comment_type): output_file.close()