From 963f04071582bb27782b82d8292d0e633cc809bf Mon Sep 17 00:00:00 2001 From: wpbonelli Date: Tue, 27 Feb 2024 16:05:08 -0500 Subject: [PATCH] accommodate preprocessor directives --- .github/common/update_fortran_style.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/common/update_fortran_style.py b/.github/common/update_fortran_style.py index b3249203c7b..ca4bedbbb97 100644 --- a/.github/common/update_fortran_style.py +++ b/.github/common/update_fortran_style.py @@ -118,7 +118,10 @@ def cleanup_comments(path, check, diff): nspaces = len(lines[0]) - len(lines[0].lstrip()) indent = "".join(repeat(" ", nspaces)) - if not any(line): + if comment.startswith("#"): + # preprocessor directives + flines.extend(lines) + elif not any(line): if any(pattern in comment for pattern in ["!!", "!<", "!>"]): flines.extend(lines) elif "SPECIFICATIONS" in comment: